Author |
Message
|
Armin |
Posted: Wed Jul 25, 2001 8:30 am Post subject: |
|
|
Novice
Joined: 24 Jul 2001 Posts: 15 Location: Germany
|
I have to convert pipe-delimited input messages into MRM-Format (e.g. data1|data2|. My idea was to receive msgs as BLOB, change all occurences of '|' to X'00' and reset the content descriptor to my MRM-Format to further process the message. I managed to access the incoming blob in a Trace Node(via Root.BLOB.BLOB), but how can I access the BLOB contents in the compute node and alter it? InputRoot.BLOB.BLOB and OutputRoot.BLOB.BLOB are not working. Any ideas? Or is there a better way? Maybe not using BLOB, but instead using MRM with only one very long field as input and then after conversion of | resetting the message descriptor? Any help apreciated.
Armin |
|
Back to top |
|
 |
kolban |
Posted: Wed Jul 25, 2001 8:36 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
I don't think working with BLOB data is going to be the right answer. I would personally use the NEON formatter to recognize incoming fields delimited by '|'. Once parsed, you can then move the recognized fields into an MRM message tree and you should be done. |
|
Back to top |
|
 |
Armin |
Posted: Wed Jul 25, 2001 9:05 am Post subject: |
|
|
Novice
Joined: 24 Jul 2001 Posts: 15 Location: Germany
|
Our goal was to avoid NEON if any possible, because we were not very happy with NEON Integrator 1.1 . We tried to do it the "Integrator 2 Way" . Besides your tip to use NEON, just for curiousity, is there a way to access blobs in compute nodes?
Armin |
|
Back to top |
|
 |
kolban |
Posted: Wed Jul 25, 2001 9:42 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
The BLOB parsed data can be accessed in a compute node but its not pretty. A BLOB is a bytearray of data ... untyped. If cast to a string, it takes on the representation of a hex string ... eg. if the message on the queue contains "ABC|123" and this is read as a blob, 7 bytes of data (as expected) are returned. If cast to string, its value would be:
'4142437C313233'
This means that you can't look for '|' in the string since it isn't there!!! Its character representation is '7C'. All in all, BLOB sub-parsing is pretty limited. Strongly suggest the NEON parser or a custom parser that you could write in C or C++.
Remember, the NEON parser is fully supported within the MQSI V2 environment. Define the Input Format using the NEON formatter GUI and then define the MQInput node to use the NEON parsing ...
[ This Message was edited by: kolban on 2001-07-25 10:44 ] |
|
Back to top |
|
 |
EddieA |
Posted: Tue Aug 07, 2001 9:10 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
I would agree with Neil that you really should use the NEON parser for this.
But, if you really, really, really, have to do this as a BLOB, then I can post some code that will do this. (It was originally written to add hex values to an MRM message).
Cheers,
_________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Armin |
Posted: Thu Aug 09, 2001 8:34 am Post subject: |
|
|
Novice
Joined: 24 Jul 2001 Posts: 15 Location: Germany
|
I´ve already done it the "BLOB-way". It works like a charm. The real problem was, that everytime I enteres a statement like
SET OutputRoot.BLOB.BLOB = ......
in a compute node, the compute note synax checker showed an syntax error. I spend a lot of time figuring out, that my code in fact is ok and runs pretty good in the broker. I just ignored and deployed it. Not very nice but it works.
Maybe its a problem of MQSI version 2.0.1
Thanks for all your help offers
Armin
|
|
Back to top |
|
 |
kolban |
Posted: Thu Aug 09, 2001 8:56 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Aha!!! Been there, done that.
BLOB (the word) is an ESQL keyword. Like other keywords, you can use those in tree names but you have to escape their special meaning with the " character.
Instead of entering:
SET OutputRoot.BLOB.BLOB = ...
which will raise a syntax error, use:
SET OutputRoot."BLOB"."BLOB" = ...
All will now be well. I always "escape" my tree component names as a matter of habit. |
|
Back to top |
|
 |
Armin |
Posted: Thu Aug 09, 2001 9:59 am Post subject: |
|
|
Novice
Joined: 24 Jul 2001 Posts: 15 Location: Germany
|
>I always "escape" my tree component names as a matter of habit.
Good idea. I will adopt it. And sorry for blaming the syntax checker
Armin |
|
Back to top |
|
 |
Tibor |
Posted: Fri Aug 10, 2001 12:21 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
You can handle a BLOB message with substring function. It isn't smart but works. And, of course, lightning fast. |
|
Back to top |
|
 |
|