Author |
Message
|
brgmo |
Posted: Tue Dec 11, 2007 2:36 am Post subject: Storing Message |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Hi All,
I have a requirement wherein i have to store the message until the received message is transformed properly.Then i have to forward the stored message and the transformed copy the message to two different queues. How can i do this?
Regards
brgmo. |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Dec 11, 2007 2:54 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi brgmo,
Your question is not very clear, but from what I have understood, I think you can achieve the requirement by using a simple PROPAGATE...(unless the transformation is being done outside the flow )
Regards. |
|
Back to top |
|
 |
brgmo |
Posted: Tue Dec 11, 2007 3:10 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Let me reword my question.My messag flow receives a message from the queue.After receiving the message,the requirements are that i need to store the message.So,my first question is where to store the message in the broker environment(not database) so that it remains intact even in the case of exception.The next stepis to transform the message.If the transformaton is successful,i would like to forward the stored message and the transformed message to two different queues.How i can achieve this.
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 11, 2007 3:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
So,my first question is where to store the message in the broker environment(not database) so that it remains intact even in the case of exception. |
The broker environment cannot be guaranteed in the event of exception or failure. Use a database.
brgmo wrote: |
The next stepis to transform the message.If the transformaton is successful,i would like to forward the stored message and the transformed message to two different queues.How i can achieve this. |
a) Why store the message at all? If the transformation is unsuccessful, roll back to obtain the original message.
b) Use two different legs for the send? Use PROPOGATE? Either would work.
c) If you store the message, don't forget to delete it once the transformation is successful. Unless you want an audit trail. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Tue Dec 11, 2007 3:47 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Can i do it this way:
1.Store the received message in Environment tree.
2.Do the transformation of the recvd msg.
3.If transformation successful, then
Propogate stored message to Q1
Propogate xmed message to Q2
Even if the exception occurs,the environment tree will remain intact.
Regards
brgmo. |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Dec 11, 2007 3:53 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi brgmo,
I guess I did get your requirement right.
1. Do a propagate from a compute node..
2. Put a try catch block and inside it, do the transformation...if successful send it to your output queue, if failed, catch and do whatever...
3. After this is done, control will return to the compute, from there use the current message(which is your stored msg), and send to your 2nd desired queue.
Regards. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 11, 2007 3:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
Even if the exception occurs,the environment tree will remain intact.
|
Sure?
Does it scale?
I stick with my suggestion, as expanded quite beautifully by elvis_gn, of using unit of work. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Tue Dec 11, 2007 3:59 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Thanks a lot guys. Just one more question.If i want to propagate the message one by one to different queues,how can i do that. I mean i will generate messages within the same compute node but i need to forward that to different queues using propagate statement. I mean can i do something like below pseudocode:
Set msg 1 = Do Smething;
Propogate to Q1;
Set msg 2 = Do Smething;
Propogate to Q2;
....
....
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 11, 2007 4:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Given that msg1 and msg2 in your pseudocode are both the OutputRoot. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
brgmo |
Posted: Tue Dec 11, 2007 4:19 am Post subject: |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
How to write the code for that i mean propogating messages to two different queues in the same comput node.
Regards
brgmo. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 11, 2007 4:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
brgmo wrote: |
How to write the code for that i mean propogating messages to two different queues in the same comput node.
|
Look up the PROPOGATE verb in the ESQL reference. You build the message you want in the normal way and PROPOGATE it out. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|