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 » TDS help

Post new topic  Reply to topic
 TDS help « View previous topic :: View next topic » 
Author Message
vmurali_au
PostPosted: Wed Aug 09, 2006 3:49 pm    Post subject: TDS help Reply with quote

Voyager

Joined: 26 Mar 2004
Posts: 76

I'm having a msg which is like

A1 A2 A3 A4 A5...

There can be one or multiple spaces between these fields. Also the fields A1, A2, A3, A4, A5 etc, are of variable length.

Is "data pattern" the only way to parse this message as TDS? I'm afraid that if i use data pattern then it is a performance bottle neck.

Actually the above mentioned is only one line in the message i've to parse. The other lines in the msg doesnt even have consistent delimiters to be modelled into TDS. But the above mentioned line contains the important routing information, so that i can route the message as a BLOB to the appropriate transformation flow for that kind of message which parses the BLOB message body using java compute node.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 09, 2006 6:11 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

As long as the fields themselves don't contain spaces, you can use the space as a delimiter.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Aug 10, 2006 1:25 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
There can be one or multiple spaces between these fields
Then you need to use data patterns. Delimiters are fixed-length in all current versions of the broker. Note that v6 is much faster at executing data patterns than any previous version.
Quote:
Actually the above mentioned is only one line in the message i've to parse. The other lines in the msg doesnt even have consistent delimiters to be modelled into TDS
I never cease to be amazed at the data formats that people invent! For my own interest and education, could you supply a few more details
- Which industry is using this format?
- Does each line have an identifying field at the start?
- What other 'features' does this format have?

Whatever the exact details, you can probably parse your message using data patterns if you are prepared to experiment a little.
Back to top
View user's profile Send private message
vmurali_au
PostPosted: Wed Aug 16, 2006 12:35 pm    Post subject: Reply with quote

Voyager

Joined: 26 Mar 2004
Posts: 76

Sample Message:


1 ABCD EFG
Employee_Data_Entry value1 value2 value3
NAME/John Galt .AGE/14 :EMAIL/john.galt@gmail.com :ADDRESS/424,Adam Street,
Templton, AZ 19905 .MOBILE/98102829029 .MARRIED/Yes


The 1st 2 lines are the header information of the message which i have to parse and get the information required for routing.

The other lines (lines 3 & 4) contain the information required for executing the transaction, say "Employee_Data_Entry". We have 600 such different transactions each with variable payload length and each having a different set of elements in the payload (as in lines 3 & 4). The delimiters can vary between (. or : or '\n' or end-of-text).

I guess it is impractical to identify the length of each field (which can have one to many white spaces), and create a TDS message structure for each of the 600 transactions and then parse it.

So right now, i'm trying to get the message as a BLOB in MQInput node and CAST the message payload to character string and use regular expressions (available in jdk 1.4.2) in java compute node to extract the individual name-value pair elements (using delimiters '.' or ':' or '\n' or 'end-of-text'). After parsing, i've to check whether i've got all the required name-value pairs required for the particular transaction (transaction name is available in the 2nd header line) , else throw error.

I feel the TDS message set is practically useless in this case. I wonder how Message Broker will be useful in actually parsing this kind of message. I can very well write a stand alone java class which uses regular expressions to parse this message, that is what i'm planning to do in the Java Compute Node in the broker.

Any inputs on how to handle and parse these kinds of messages will be really helpful.
Back to top
View user's profile Send private message
vmurali_au
PostPosted: Wed Aug 16, 2006 1:04 pm    Post subject: Reply with quote

Voyager

Joined: 26 Mar 2004
Posts: 76

Also as an Response to the above transaction, i've to produce similar kind of legacy text from the XML response message i receive from backend.

I was planning to create stylesheets to convert XML to this kind of legacy text. But now i found that the XMLTransformation node in MB will convert XML only to XML.

So i'm planning to use Xerces or any other XSL api inside Java Compute Node to convert the XML response to legacy text using the style sheets.

I could also very well manually construct a BLOB output message from the XML response in a compute node by manually adding the required delimiters and white spaces. But i guess the code will then be less maintable than using the XSL stylesheets.

I'm sad that i'm not able to use the Message Brokers support both in the request and response scenarios

I donno whether i'm proceeding in the right direction. Can anyone confirm the validity of my approach?

Any help will be really appreciated.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 16, 2006 1:12 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Anything you can process in Java using Regular Expressions, you should be able to model in MRM using Data Patterns.

Anything you can model in MRM you can transform back and forth between XML or anything else you can model in MRM or otherwise describe in Broker.

I personally only use the XMLTransformation node if there is an already existing stylesheet that the customer insists on using.

Remember that everything in Broker is a logical message tree, completely isolated from physical formats except for at parsing and serializing. So you have three separate tasks for any given transformation - describe a way to parse the data into a logical message tree, build a way to transform a logical message tree to another logical message tree, and describe a way to serialize the message tree into another bitstream.
_________________
I am *not* the model of the modern major general.
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 » TDS help
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.