cancel
Showing results for 
Search instead for 
Did you mean: 

Time to Live

alfonsoarmenta
Explorer
0 Kudos
394

Hello,

trying to find out how to emit messages using the messaging service (com.sap.cds.services.messaging.MessagingService) to Event Mesh and setting a time to live in Java.

View Entire Topic
venkateshkasira
Associate
Associate

Hi slithzerikai
you can refer CAP Java Documentation for messaging mostly time to live will be set in Queue Configuration as maxTtl called as Expiration Period. If would like to override in application it can be set using config similar to below

note respectTtl should be true

cds:
  messaging:
    services:
      - name: "messaging"
        queue:
          name: "my-queue"
config: maxTtl: 300, respectTtl: true
alfonsoarmenta
Explorer
0 Kudos

I get a "We're sorry, but this content is not accessible." in the second link you provided, which is also linked from the first.

I had tried this in my configuration but it was ignored. I have now figured out the problem, the max TTL and the respect TTL are not properties of the 'queue' property but of the 'config' property, which is a property of the queue...

cds:
  messaging:
    services:
      - name: "messaging"
        queue:
          name: "my-queue"
          config:
            maxTtl: 300
            respectTtl: true
Can I accept my own answer as 'the answer'? 🙂
venkateshkasira
Associate
Associate
0 Kudos

SAP Event Mesh - REST APIs for Messaging Management

above is second link should work, sure if you are able to solve the issue thats great.