How to read messages in batches from tMomInput?

Six Stars

How to read messages in batches from tMomInput?

I am using TOS 5.6.1. I want to read messages in batches from tMomInput and write it into a file. The max. number of messages in each file should be 25. Could someone please give me some suggestion?

I am able to read one message at a time, but not in batches. Thanks.

 

 

Moderator

Re: How to read messages in batches from tMomInput?

Hello,

So far, there is no "use batch size" in tMomXXX components. Feel free to create a new feature jira issue of DI project on talend bug tracker.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: How to read messages in batches from tMomInput?

Hi Sabrina, thanks for your reply. I tried to achieve this using tLoop as shown below. But since tMomMessageIdList has only "iterate" to connect to another component, when it goes to that iterate, its not coming back to the tLoop iterate. Is there any other way to pull messages from tMomInput as batches?

tLoop.GIF

Community Manager

Re: How to read messages in batches from tMomInput?

This is a "thinking outside the box" type solution, but I think this tutorial might help you. Instead of thinking about batching the request, think about batching the output. The tutorial below demonstrates how to write to a different file depending on the data being supplied.

https://www.rilhia.com/tutorials/load-data-dynamic-number-files

If you were to add some sort of sequence mechanism to your messages, you could quite easily write to a different file every time that sequence reached a max number of messages.

Highlighted
Six Stars

Re: How to read messages in batches from tMomInput?

Thanks for your help. I will check that out.

Community Manager

Re: How to read messages in batches from tMomInput?

Did this resolve your question? If so can you set it to resolved so that others can benefit from this?

Six Stars

Re: How to read messages in batches from tMomInput?

Thanks for your solution. But I got stuck and couldn't make this work. So for now I am sending one message at a time.

Four Stars

Re: How to read messages in batches from tMomInput?

Have you done with your batching concept? Because i need help in this batching concept. Plz let me know how to do this?

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now