0
votes

I am endeavouring to upgrade to the latest spring cloud/dataflow/stream release in order to acquire the recent addition of being able to specify the delivery mode persistence on messages that end up being dead-lettered in a dataflow stream.

I tried the latest Dalston.SR1 release and found that messages did end up being routed to the dataflow dlq and being marked as persistent but only when the app (e.g. a processor) was run standalone.

When the app is run as part of a dataflow stream, no messages are written to any of the dead letter queues in the dataflow stream. Turning on trace logging for spring amqp showed that this was due to the wrong routing key being used.

What I see in the logs is this:

o.s.amqp.rabbit.core.RabbitTemplate      : Publishing message on exchange [DLX], routingKey = [mystreamname]

This seems like a bug: the stream name now being used as the routing key in a dataflow environment whereas standalone, and previously in dataflow, it's based on the queue name.

Has the rabbitmq binder configuration now changed? Here is a snippet from my binder config for a processor (assume spring.cloud.stream prefix):

  bindings:
    input:
      consumer:
        backOffMultiplier: 1
        maxAttempts: 1
      group: mygroup
  rabbit:
    bindings:
      input:
        consumer:
          autoBindDlq: true
          durableSubscription: true
          republishToDlq: true
          content-type: application/json
      output:
        producer:
          autoBindDlq: true
          content-type: application/json

This is working nicely in production with Camden.SR6 and dataflow 1.1.4.RELEASE (aside from the dlq persistence being absent).

Am I doing anything wrong, or is there a routing key related bug?

1

1 Answers

0
votes

I am not aware of any intended behavior change; please open a GitHub issue so it can be investigated.

In the meantime, Dalston has a new rabbit consumer property deadLetterRoutingKey which allows you to explicitly set it. You should be able to work around the issue with that.