Solace Community is getting a facelift!

On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.

We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!

How to keep message listener up and running to asynchronously keep receiving messages

rgundra
rgundra Member Posts: 1

Hi,
I am using JCSMP API. For listening to messages. I am using asynchronous receiving by implementing XMLMessageListener. Once I started FlowReceiver, it starts listening to messages, my program terminates after some time. I want my listener to be up and running until I terminate my program. Is it possible keep the listener up and running without a web container like tomcat. Please suggest on this.

Tagged:

Answers

  • TomF
    TomF Member, Employee Posts: 412 Solace Employee

    Hi @rgundra, the FlowReceiver is an aynschronous, callback based object, so there's actually nothing going on in main. If you don't give main something to do, it will just complete and your application will terminate. Have you looked in the SolaceSamples Github repo? You can see the various approaches the samples take to this.

This Month's Leaders

This Week's Leaders