我正在使用 Mule SDK 开发自定义连接器。我正在获取必要的元数据。以下是我使用的两个片段: WeatherConnectrOperations.java:
public class WeatherConnectrOperations {
public void select(@MetadataKeyId(RecordKeysResolver.class) String type) {
}
}
RecordKeysResolver.java:
public class RecordKeysResolver implements TypeKeysResolver {
@Override
public String getCategoryName() {
return "Records";
}
@Override
public Set<MetadataKey> getKeys(MetadataContext context) throws MetadataResolvingException, ConnectionException {
System.out.println("Hello");
List<String> keyIds = Arrays.asList("Author_id", "BookList_id", "Book_id");
HashSet<MetadataKey> keys = new HashSet<>();
for (String id : keyIds) {
MetadataKeyBuilder builder = MetadataKeyBuilder.newKey(id);
builder.withDisplayName(StringUtils.removeEnd(id, "_id"));
keys.add(builder.build());
}
return keys;
}
}
我的问题是,类型字段没有填充必要的键
我正在按照本文档执行 - https://docs.mulesoft.com/mule-sdk/1.1/metadata-keys