|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Setting up a Message set for parsing a simple text message |
« View previous topic :: View next topic » |
Author |
Message
|
jonasb |
Posted: Mon Oct 27, 2008 1:47 am Post subject: Setting up a Message set for parsing a simple text message |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
Hi,
I get simple text messages on an MQ queue a want to parse them by line,
i.e.
msg:
this is the firstline
and this is the second
parsed (in xml syntax to make it more understandable):
<message>
<line>this is the firstline</line>
<line>and this is the second</line>
</message>
This seems like a simple enough task, yet I have struggled with it for some time now.
If someone could give me some pointers it would be greatly appreciated.
I have tried TDS with different DataElementSeparation schemas (including UseDataPatterns) but I do not get it to parse.
I guess I could use BLOB and separate manually on "[\r]\n", but I do not want to revert to that unless I need to.
Kind Regards, _________________ contact admin |
|
Back to top |
|
 |
hopsala |
Posted: Tue Oct 28, 2008 3:15 am Post subject: |
|
|
 Guardian
Joined: 24 Sep 2004 Posts: 960
|
This is indeed not a difficult task, and you're probably stuck on some TDS parameter you've mal-configured. One way to do what you want is to have a TDS message, that has one child called "line" which can be repeated, delimited using "All elements delimited" with linebreak (<BR><CR> if memory serves) as the delimiter.
Further help can be found in the CSV sample in the samples gallery - in the toolkit click "help" and then "samples gallery", it should be under "technology samples". Import the sample, and go over the explanation in the sample gallery; you'll find a detailed explanation under "read about the sample" and then clicking "Exploring CSV the sample"
Otherwise, post here your code and the exact contents of your message set configuration, and the exception you're getting, and we'll try to help. Be advised, though, that it will be much quicker for you to solve it on your own, aided by the CSV sample.
Keep us posted, and good luck! |
|
Back to top |
|
 |
jonasb |
Posted: Wed Oct 29, 2008 2:34 am Post subject: |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
Thanks for your input. I just recreated the message set from scratch again and it work the first time... _________________ contact admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|