ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Ordering of multiple messages or parsing in reverse order

Post new topic  Reply to topic
 Ordering of multiple messages or parsing in reverse order « View previous topic :: View next topic » 
Author Message
taankyu
PostPosted: Tue Dec 02, 2014 6:05 am    Post subject: Ordering of multiple messages or parsing in reverse order Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Need some help on this :
I have flat file with multi row records -
ROW1
ROW2
ROW1
ROW2...

I am parsing the file in compute node and sending ROW1 as one message and ROW2 as different message.
But , I need to send message for ROW2 followed by ROW1 - need help on this
Or is it possible to parse the file from bottom to top.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Dec 02, 2014 6:35 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

If the file will never be too large, you could make the file node read it as a single object (record detection = whole file).

Then you can step through the data in ESQL - looking for record delimiters (if it's not fixed length) and put each record into an ESQL storage array.

Then you can process it in whatever order you want and issue propagate from the compute note to a MQoutput node for each message.

Don't forget to set up your MQMD properly (format = MQSTR, CCSID, persistent or whatever).
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Dec 02, 2014 7:00 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You could create a message model that includes both RECORD1 and RECORD2 in a single record, and then parse the file based on the record. Then you would propagate each set as a message, and could further propagate or process each record as you felt.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Dec 02, 2014 10:16 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Unfortunately the files are of large size ... is there some way we can parse the file in reverse order - bottom to top

I tried with message model but the log file has many elements in it which are not well defined and combining the two rows as one record was causing issues
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 02, 2014 10:26 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

taankyu wrote:
Unfortunately the files are of large size ... is there some way we can parse the file in reverse order - bottom to top


No.

taankyu wrote:
I tried with message model but the log file has many elements in it which are not well defined and combining the two rows as one record was causing issues


If the elements are not well defined, then any message model will have issues. No matter which order you're parsing the file.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Dec 02, 2014 10:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

None of the File nodes in Broker support reading from the file in "reverse" order.

Perhaps you could consider not writing to a file in the first place, and using something like a database instead.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Dec 02, 2014 10:38 am    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Thanks a lot everyone ...
We get the log files from external sources [Not much control over that]

Just able to parse the required fields using FILLERS and adjustments.
Somehow , struggling in ordering of messages - ROW2 before ROW1
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Dec 02, 2014 10:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The File nodes require that you read records from the start of the file to the end of the file.

You then have all of the capabilities of Broker at your disposal to do whatever you want with those records, for example put them somewhere else for processing in a different order.

It's otherwise relatively easy to reverse the contents of a file using OS tools or a simple script.
Back to top
View user's profile Send private message
taankyu
PostPosted: Tue Dec 02, 2014 12:06 pm    Post subject: Reply with quote

Novice

Joined: 15 Nov 2014
Posts: 20

Thanks..able to parse the required information after reversing the file
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Dec 02, 2014 11:14 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Define "large" in a more scientific way. How large?
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
maurito
PostPosted: Wed Dec 03, 2014 12:49 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

1- set the file input node to read one record at a time.
2- if it is ROW1 put it in SHARED
3- if is it ROW2 write it, and then write whatever is in shared, reinitialize shared.
etc.
Do not use additional instances.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Ordering of multiple messages or parsing in reverse order
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.