Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
AManohar
Contributor II
Contributor II

How to close connection of a tMomInput component with Keep Listening enabled.

Hi,

Most of our jobs have a tMomInput component with 'Keep Listening' enabled. And the services are always listening to the queue for input messages.

In order to stop the service we need to Inhibit the get messages on the queue in the Queue manager and Kill the talend service.

Is there a way to close the tMomInput connection in the job based on a condition. We tried using the tMomcommit component with close connection option, but that doesnt seems to be working.

Labels (3)
4 Replies
Anonymous
Not applicable

Hello,

Here exists a jira issue on talend bug tracker about "Add the possibility to stop the looping of the tMOMInput"

https://jira.talendforge.org/browse/TDI-4453 and from one of the JIRAS (https://jira.talendforge.org/browse/TDI-4504), there was a suggestion to see a break statement to get out of the main loop so that the job stops.

If you unselect Keep Listening, a break is used to get out of the main loop code used in the begin part of the component:

if(Integer.valueOf(remoteQtMomInput_1.getCurrentDepth()).equals(0)) break;

 

We have 3 kind of way to retrieve the message from queue/topic 'Keep listening' always running to listen the message from the server only break by exception or kill job manually 'retrieve number of messages' you need set a number, when the number of message reach it. then reading would be stopped both 'Keep listening' and 'retrieve number of messages' unchecked. The component would be stop read when the queue is empty after sleep the time which is set in the component.

 

From your description, you could unchecked the 'keep listening' box and also set the 'Sleeping time in(sec) ' value, the 'sleeping time' would tell ActiveMQ how long the consumer should be listening to the queue before quitting. This solution would be better than killing the job

Hope it helps.

Best regards

Sabrina

Anonymous
Not applicable

Hello @AManohar

Is there any update for you issue? Does the above solution work for your use case?

Feel free to post your issue here.

Best regards

Sabrina

AManohar
Contributor II
Contributor II
Author

Hi,

 

The solution to have loop to the tMOMInput seems to be working for our scenario.

But ,the only issue we found is , since we are connecting to the tmominput component multiple times ,there are too many system logs with following messages.

 

Ready to receive message

Waiting...

Disconnecting queue manager...

Disconnecting queue...

Disconnecting queue manager...

 

So its hard to track the actual job status logs.

Not sure yet on how to get rid of these logs.

If we turn off system logs completely , the other valid log messages will also not be displayed.

Haven't tried LOG4J yet.

 

Is it possible to disable these log for tMOMInput component.

 

Thank you.

Anonymous
Not applicable

Hello,

Please have a look at this topic about:

https://community.talend.com/s/question/0D53p00007vCrkdCAC/disable-default-systemoutprintln-statemen... and feel free to let us know if it if what you are looking for.

Best regards

Sabrina