I've got this configuration:
spring:
cloud.stream.bindings:
input-product-created:
content-type: application/json
destination: output-product-management
input-product-deleted:
content-type: application/json
destination: output-product-management
And the proper methods withing the handler:
@StreamListener(Channels.PRODUCT_CREATED)
public void inputProductCreated(ProductCreatedEvent event) {
productService.createFrom(event.getProductDto());
}
@StreamListener(Channels.PRODUCT_DELETED)
public void inputProductDeleted(ProductDeletedEvent event) {
productService.delete(event.getProductId());
}
For some reason only the first method is invoked (I've analyzed the producer and it properly generates create/delete events). I assume the problem is with multiple events in the same destination. How to differantiate them correctly?