โ06-16-2017 10:17 AM
I am reading multiple messages using JMS consumer into one big binary file then using a binary to document snap I am breaking it into multiple documents. How can I write each document to a separate file with timestamp rather than writing all the documents at the end to one file?
I know there is a way to do that using ForEach pipeline where you can send each document seperately but I donโt want to use a master pipeline and a child pipeline. I want all operations to be done in one single pipeline.
โ06-18-2017 11:18 PM
@Bhavin
Thank you this what I ended up doing and the closest thing to my solution. I have one clarification though regarding using two JMS Acknowledge snaps (Acknowledge, Reject) instead of just one. Isnโt the other JMS Acknowledge snap for โRejectโ redundant? Why cannot we use just one Acknowledge snap and if the message processed successfully then it will be acknowledged but the message wasnโt processed and didnโt make it till the end then the message wonโt be acknowledged therefore it will remain in the queue for future processing. I donโt see what difference would it make to add a Reject snap with Recover message box checked since the first Acknowledge snap can cover both scenario.
Regarding your request to share the JMS account configuration I will be more than happy to share it below ๐
โ06-20-2017 01:05 PM
Isnโt the other JMS Acknowledge snap for โRejectโ redundant?
yes, mine was geared more towards โastheticsโ ๐
Regarding your request to share the JMS account configuration I will be more than happy to share it below
much obliged
โ06-20-2017 01:15 PM
Getting back to your original question, you can write separate documents with the JSON-Formatter, XML-Formatter, and DocumentToBinary snaps. You can then configure the FileWriter snap with an expression for the file name, for example:
'out_' + Date.now() + '.json'
Or, if you just want a sequence number, you can use the โsnap.in.totalCountโ variable:
'out_' + snap.in.totalCount + '.json'
So, every document generated by the formatter snap will be written to its own file with the name computed by the expression.
To configure the formatters:
โ06-20-2017 05:06 PM
@mohamadelmardini For breaking up each document from JMS queue we are following the same method as they suggested above,do we still having issue breaking up the documents ?also the JMS acknowledge we were able to acknowledge the messages based JMS Message ID as suggested above only thing we didnโt do is having the reject acknowledge .
โ06-21-2017 10:44 AM
Sandeep the original solution wasnโt working when I tested it out. I updated the approach and it is working now. You can check it out at DEV environment.
All is good now.