1

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

2020欧洲杯时间表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());
}

2020欧洲杯时间表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?

  • You can't do that; you need to use separate topics. I would expect to see a conversion error when the ProductCreatedEvent is attempted to deliver to the second method. – Gary Russell Mar 23 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy2020欧洲杯时间表

Browse other questions tagged or ask your own question.