Set TTL Apache Camel JAva DSL

后端 未结 2 1289
闹比i
闹比i 2021-01-28 01:16

How do you set the TTL for a message when using Java DSL?

I have something like this:

...
from (\"timer:something?delay=3000&period=15000\")
   ...
          


        
2条回答
  •  心在旅途
    2021-01-28 01:45

    I ended up setting the JMSExpiration header field of the messages being created similar to the following

    .setHeader("JMSExpiration", constant(System.currentTimeMillis() + 1000))
    

    We are using Apache ActiveMQ 5.7.

提交回复
热议问题