ฉันใช้ 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