Author |
Message
|
paulgroo |
Posted: Wed Mar 07, 2007 4:42 am Post subject: ESQL stuff |
|
|
 Centurion
Joined: 07 Jul 2005 Posts: 138 Location: Ireland
|
Hi everyone,
I've been trying to get something working in Message Broker and I just cant get it quite right...
I am receiving a message in plain text onto a queue, and I want the Compute node to read the text and send it to either one of two queues. (There are only two types of messages that arrive on this queue). The issue is with the message type Im using I think, I have a feeling I should be using BLOB messages (?). Has anyone here created similar ESQL for a compute node before?
I can post my ESQL code if needed... |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 07, 2007 5:02 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you're not trying to model the data, then yes "plain text" = "BLOB".
Depending on what you mean by "read the text", you might need to CAST InputRoot.BLOB.BLOB as Character. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
paulgroo |
Posted: Thu Mar 08, 2007 2:21 am Post subject: Hi Jeff |
|
|
 Centurion
Joined: 07 Jul 2005 Posts: 138 Location: Ireland
|
Thanks for the reply! Yes, that sounds like what I need to do. Basically, two types of message arrive onto this queue and I want to the compute node to route one type to one queue and the other to a second queue.
I'm sort of new the whole ESQL bit and I was wondering if you knew of any comprehensive guides to writing ESQL? I've configured ESQL (with a lot of trial and error) to route XML messages but Im not sure what Im doing with 'BLOB' messages.
Last edited by paulgroo on Thu Mar 08, 2007 2:27 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 08, 2007 2:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
There's an ESQL manual, but it's not really a training aid. However, if you've got experience of other languages it should offer enough help to get you going....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
paulgroo |
Posted: Thu Mar 08, 2007 2:29 am Post subject: |
|
|
 Centurion
Joined: 07 Jul 2005 Posts: 138 Location: Ireland
|
Thanks Vitor! I'll give it a go anyway and see what I can do myself anyway. I think there's a few samples that I might be able to 'doctor' to suit my needs! Thanks for the reply! |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 08, 2007 6:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Let's pretend that the 30th to 40th position of your BLOB text have the routing token you will use to determine the final queue.
Your code would look something like
Code: |
declare token CHARACTER;
set token = SUBSTRING(InputRoot.BLOB.BLOB from 30 for 10);
set token = CAST(token as Character CodedCharSetId InputRoot.Properties.CodedCharSetId);
if token = 'aaaaaaaaaa' then
--route to queue 1
else if token == 'bbbbbbbbbb' then
-- route to queue 2
end if; |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|