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 » Synchronous messaging

Post new topic  Reply to topic
 Synchronous messaging « View previous topic :: View next topic » 
Author Message
cutejigs
PostPosted: Tue Mar 26, 2013 10:34 pm    Post subject: Synchronous messaging Reply with quote

Novice

Joined: 20 Jan 2010
Posts: 20

hi gurus,

i have requirement to make an asynchronous messaging into synchronous messaging. the flow works like this:

Flow 1
MQInput Node -> JavaCompute Node -> TCPIPServer Input

Flow 2
TCPIPServer Output -> JavaCompute Node -> MQOutput Node

Flow 1 gets, transforms and sends the request message to the TCPIP.
Flow 2 gets the response and add the response to the original request (from Flow 1) and send this to MQOutput Node.

my challenge is now is i can not use any database to store the original request from Flow 1. aside from this, the response that i will be sending for Flow 2 should include the original headers (basically the whole request plus an additional element coming from the response).

i already tried using static Java objects to store the original request (putting the MbMessage as an object and as a bitstream) but still no success. i also saw on the InfoCenter that caching MbMessage and MbElement objects are not supported.

what i basically tried to do is save the original request including the headers for later retrieval when a response was receieved from TCPIPServer output. could you guys help me in resolving this problem?

thanks!
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Mar 27, 2013 12:42 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Aggregation!

Read, learn, experiment, learn and away you go.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Esa
PostPosted: Wed Mar 27, 2013 12:49 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

check what I just replied in the other thread where you asked the same questions.
Back to top
View user's profile Send private message
cutejigs
PostPosted: Wed Mar 27, 2013 3:22 pm    Post subject: Reply with quote

Novice

Joined: 20 Jan 2010
Posts: 20

thanks esa! sorry for double posting, i just thought i might not be really clear on what objective i am trying to achieve.

@smdavies i tried to use that approach but notice that some responses are being sent on the incorrect requestor (which i am still investigating).
Back to top
View user's profile Send private message
McueMart
PostPosted: Thu Mar 28, 2013 4:10 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

Firstly can we clarify a few things:

Is your broker flow initiating the connection to an external application over TCP? If so I would have expected you should be using the TCPIPClient nodes. (TCPIPServer nodes are when an external application initiates a connecting into the Broker).

So if im correct your flows would actually look like:

Flow 1:
MQInput -> JavaCompute -> TCPIPClient Output

Flow 2:
TCPIPClient Input -> JavaCompute -> MQOutput


So what you could do, without actually changing the data you are sending over TCP (in order to insert a unique ID in it), is do something like this:


Flow 1:
MQInput -> JavaCompute -> TCPIPClient Output --> JavaCompute (1) --> MQOutput

Flow 2:
TCPIPClient Input -> JavaCompute (2) -> MQGet -> JavaCompute -> MQOutput

In javaCompute (1) you would use the LocalEnvironment to read in the connection ID (which I *think* is relatively unique!), and then use that to put the original message on a queue (setting the CorrelId equal to the TCPIP connection ID).

In JavaCompute (2) you would do the reverse, and use the connection ID (from the LocalEnvironment) to set up the CorrelID in order to do a MQGet to retrieve the original message.

This all seems quite convoluted but I reckon it would work!

(Or of course you could learn how to use Aggregation and send an Echo message to the Fan-In! )
Back to top
View user's profile Send private message
cutejigs
PostPosted: Mon Apr 01, 2013 10:31 pm    Post subject: Reply with quote

Novice

Joined: 20 Jan 2010
Posts: 20

thanks McueMart! I will try it now.

As for the TCP connection, I am using TCPIP Server nodes as the external application is initiating the connection.

Cheers.
Back to top
View user's profile Send private message
Esa
PostPosted: Mon Apr 01, 2013 11:56 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

cutejigs wrote:

As for the TCP connection, I am using TCPIP Server nodes as the external application is initiating the connection.


cutejigs wrote:
Flow 1
MQInput Node -> JavaCompute Node -> TCPIPServer Input


You cannot have a flow like that. TCPIPServerInput is an input node: it doesn't have any input terminals.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 02, 2013 4:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Go find a whiteboard. Ideally one that has a lot of writing on it and says "Do not erase".

Erase it. You have my permission.

Draw on it a box. Label this box "external application". Draw another box, labeled "broker". Draw lines between these two boxes that indicate what data is flowing in what direction.

Draw a bigger box, labeled "message flow". Draw lines coming into that box that correspond to lines coming into the box labeled "Broker" on the other picture. Draw lines going out of this "message flow" box that correspond to lines coming out of the box labeled "broker" on the other picture.

Each line that comes into the "message flow" box must end at an Input node of some kind.

Each line that leaves the "message flow box" must start at an Output node of some kind.

Now figure out the bits in the middle.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 02, 2013 5:05 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mqjeff wrote:
You have my permission.


Wow !! Nice one. Give that man a see-ghah.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
cutejigs
PostPosted: Tue Apr 02, 2013 4:04 pm    Post subject: Reply with quote

Novice

Joined: 20 Jan 2010
Posts: 20

@esa sorry, my mistake. it should have been:
Flow 1
MQInput Node -> JavaCompute Node -> TCPIPServer Output

Flow 2
TCPIPServer Input -> JavaCompute Node -> MQOutput Node

@mqjeff/lancelotlinc you guys are genius! it did solve my problems! you are such a big help! i cant thank you enough for that contribution!
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 02, 2013 4:46 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

cutejigs wrote:
@mqjeff/lancelotlinc you guys are genius! it did solve my problems! you are such a big help! i cant thank you enough for that contribution!


The boys live to help. Glad to hear you got it all sorted.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Apr 03, 2013 6:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

cutejigs wrote:
@esa sorry, my mistake. it should have been:
Flow 1
MQInput Node -> JavaCompute Node -> TCPIPServer Output

Flow 2
TCPIPServer Input -> JavaCompute Node -> MQOutput Node

@mqjeff/lancelotlinc you guys are genius! it did solve my problems! you are such a big help! i cant thank you enough for that contribution!


I'd have been more directly helpful if I were able to understand what the problem being asked about really was.

Since it seemed you were either having difficulty understanding it yourself or explaining it, I chose to indicate my confusion by asking you to at least clarify it for yourself.

Also, I'm glad that you understood that I was making fun of myself when I acted pompous and authoritative!

Every time I speak like that, I am making fun of myself.
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 » Synchronous messaging
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.