0

I am using mapr-stream with spring integration and trying to create a publisher to send messages to maprstream topics. I am using the below Jar version compatibility matrix mentioned here.

Spring-integration-kafka - 2.0.1.RELEASE
Spring-Kafka - 1.0.3.RELEASE
Kafka-clients - 0.9.0.0-mapr-1607

As mentioned in the spring integration Kafka documentation, I should be able to set the property 'sync' in KafkaProducerMessageHandler if I am using spring-integration-kafka-2.0.1 jar, but I am getting the schema validation issues saying the 'sync' is not expected in the KafkaProducerMessageHandler.

Could someone please help me on this?

kattoor
  • 195
  • 14

1 Answers1

1

XML Namespace support for sync was not added until 2.1.

With 2.0.x, you have to set the property on the KafkaProducerMessageHandler bean programmatically.

EDIT

@Autowired
private KafkaProducerMessageHandler handler;

@PostConstruct
public void init() {
    this.handler.setSync(true);
}
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Thanks Gary for the update. But would you please provide a sample snippet for it as I am not able to set this variable. Also assuming that we will be able to achieve the actual use case of 'sync' if we set this variable programmatically. – kattoor Dec 04 '17 at 09:23
  • 1
    See my edit; if you have multiple handlers you will have to use a `@Qualifier` with the bean name, which is the adapters id + ".handler". – Gary Russell Dec 04 '17 at 17:08
  • Thanks for the update. Would I be able to set this property in the below code snippet as I am using xml configuration in our project. ` ` – kattoor Dec 05 '17 at 06:47
  • 1
    It's not clear what you are asking; the XML support was not added until 2.1. If you add another bean with the code I provided, it will set the flag for you. Add `` and ``. – Gary Russell Dec 05 '17 at 16:08
  • Yes..I got it..and its working as expected now..!I can see the performance variation if we enable sync as true..! Thanks – kattoor Dec 06 '17 at 09:51