Author |
Message
|
srk31 |
Posted: Tue Jun 23, 2015 11:07 am Post subject: routeToNode ESQL question |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
Hi,
I am new to WMB development and trying to create new service(wsdl first ) approach.
I had hello.wsdl which is having 4 operations(greetMe,sayHi,pingMe and greeMeOneWay).
here are the steps i followed.
1. File-->New-->Service
2. selected createServiceFromexisting wsdl
3. pointed the wsdl and clicked on finish.
4. HelloService was created .
Next steps.
So from here i can in two different approaches.
Aprroach 1: create new messageFlow, drag and drop the wsdl> select SOAPInput . it will create a message flow with subflow.
subflow is having soapExtract method which will direct the request to corresponding operation labelnodes.
Approach 2:
Utilize already generated stubs like following.
1. I went to folder location HelloService>Resources>Flows>gen> and opened HelloService.msgFlow in messageFlow editor.
So i i can see routeToLabel node and other handler nodes along with soapInput and soapOutput nodes.
2. HelloService> service description > clicked on greetMe and sayHi operations, so it generated subflows for each one of the operation.
so my intention was when request comes to based on operation it received, it should redirect the request to corresponding operation like soapExtract Method in approach 1.
i understand that i have to use compute node before routeToLabel node. So i created a compute node and in esql, i have to write the logic to redirect label node.
The compute node i selected mode as localEnvironment and message.
In ESQL, i am writing procedure(routingLogic) which will say route to this label node.
But in the ESQL, when i type OutputLocalEnvironment. and control space, its not showing corresponding field references.
Can any one of you help me in understanding ,
how can i access outputlocal environment/output body and Inputlocalenvironment/InputBody variables.
why i was not able access these environment variables.
The logic is something like following
if input/soap:envelope/soap:body/operationName = 'sayHi'
route to labelnode sayHi
if input/soap:envelope/soap:body/operationName = 'greetMe'
route to labelnode greetMe
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 23, 2015 11:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
if input/soap:envelope/soap:body/operationName = 'sayHi'
route to labelnode sayHi
if input/soap:envelope/soap:body/operationName = 'greetMe'
route to labelnode greetMe |
Put a trace node before your compute node. The trees are not what you think they are ... make sure you set
Code: |
${Root}
---------------------
${LocalEnvironment} |
So check out the trees and program accordingly
Remember in your ESQL the trees displayed in the trace can be accessed using InputRoot and InputLocalEnvironment  _________________ MQ & Broker admin |
|
Back to top |
|
 |
srk31 |
Posted: Tue Jun 23, 2015 12:24 pm Post subject: |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
Thanks for the reply.
even after adding trace route and provided patterns you mentioned, still outputLocalEnvironment.fieldreferences are not showing up in development editor.
i installed AirlineReservation system example, there also when i open airline xml.esql and clicked on outputlocalenvironment. ctrl+space, its not showing up destination field reference.
i was trying similar to typical java development, where you type classname. ctrl+space, it will display all the available methods.
Code: |
CREATE COMPUTE MODULE DecideOnQuery
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot = InputRoot;
IF InputRoot.XMLNSC.PassengerQuery.ReservationNumber <> '' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'SinglePassenger';
ELSE
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'AllReservations';
END IF;
RETURN TRUE;
END;
END MODULE; |
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 23, 2015 12:32 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ctl+space is a toolkit only function.
It has nothing to do with runtime.
It is tightly coupled to the specific version and fixpack and ifix level of the Toolkit itself.
You might simply have to accept that at your specific version and fixpack and ifix level don't give you that specific set of code completions. |
|
Back to top |
|
 |
srk31 |
Posted: Tue Jun 23, 2015 1:51 pm Post subject: |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
i agree. i wrote small esql code which will route the request to particular label node.
i had trace node before computenode(routingLogic) and then routeToLabel node
here is the code
Code: |
BROKER SCHEMA gen
DECLARE ns NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
CREATE COMPUTE MODULE HelloService_routingLogic
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL routingLogic();
RETURN TRUE;
END;
CREATE PROCEDURE routingLogic ( )
BEGIN
IF InputRoot.XMLNS.ns:Body.*[1] = 'sayHi' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'sayHi';
ELSE
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'greetMe';
END IF;
END;
END MODULE;
|
when i run the test case , its timing out. Could you please let me know whether the above code is correct.
[/img] |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jun 23, 2015 9:59 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
And when you test the flow with 'usertrace' on and examine the output what does it show?
Did you set the compute mode for the Compute Node correctly? _________________ 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 |
|
 |
srk31 |
Posted: Wed Jun 24, 2015 1:05 pm Post subject: |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
Thanks for your suggestion Jeff.
i enabled debugger and looked into each break point i added to the flow and observed the message.
My understanding with environment variables is different when i initially started the program.
yes i removed compute node and trace node before routeToLabel Node. I just had route to label node, which redirected the flow subflows of operation. I wrote the esql code in the subflows and gave right mode to compute node and i got the successful responses.
As i mentioned earlier we have two approaches in developing wsdl-first.
i believe that approach 1 is not real wsdl first approach. When we are saying wsdl first approach, we have to utilize the generated message flows not by creating new message flow and dropping the wsdl.
In which scenarios this approach can be followed?
So i am thinking w.r.to java webservices, we can have message handlers where you can write you are own message handler for logging requests, responses.
So in similar passion can we write logging message handlers in WMB?
I was trying to understand WMB w.r.to java server side programming in a standalone machine, not the clustered environment. so please bear with me.
1. can we have http access logs like we have in web server, where we can tweak the pattern to get total round trip times(point of entry to point of exit)
e.g: webserver-->application server-->webservice application(war/ear)-->soapengine-->mainstub-->operation-->backend dao patterns-->database calls)
can we calculate round trip times(from point of entry to point of exit) for each transaction in wmb? if so, how can i do that?
2. In java server side programming, we something called following.
a)admin server
b) managed servers, each managed server runs on its own JVM
c) application.
I am simply comparing WMB with java server in standalone machine(not cluster), my understanding is something
admin server = ??
managed server = broker instance
execution group == ??
application == bar file(actual message flows)
Appreciate your suggestions and thoughts. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 24, 2015 1:22 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Completely different on IIB.
If you want round trip stats you want to subscribe to the Integration Node's message flow's statistics. Be sure to enable the stats on the message flow after each deploy. You may also want to subscribe to the Integrations servers' resource statistics. (db access, JVM, connectors etc...)
If you are looking at detailed values per invocation, you will need to look at flow monitoring...
And have one flow dedicated to processing the monitoring information...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
srk31 |
Posted: Wed Jun 24, 2015 1:33 pm Post subject: |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
Thanks, i will take a look at them.
Can you please answer the below if you are into java world.
As i mentioned earlier we have two approaches in developing wsdl-first.
i believe that approach 1 is not real wsdl first approach. When we are saying wsdl first approach, we have to utilize the generated message flows not by creating new message flow and dropping the wsdl.
In which scenarios this approach can be followed?
=====
2. In java server side programming, we something called following.
a)admin server
b) managed servers, each managed server runs on its own JVM
c) application.
I am simply comparing WMB with java server in standalone machine(not cluster), my understanding is something
admin server = ??
managed server = broker instance
execution group == ??
application == bar file(actual message flows) |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 24, 2015 4:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
srk31 wrote: |
Thanks, i will take a look at them.
Can you please answer the below if you are into java world.
As i mentioned earlier we have two approaches in developing wsdl-first.
i believe that approach 1 is not real wsdl first approach. When we are saying wsdl first approach, we have to utilize the generated message flows not by creating new message flow and dropping the wsdl.
In which scenarios this approach can be followed?
=====
2. In java server side programming, we something called following.
a)admin server
b) managed servers, each managed server runs on its own JVM
c) application.
I am simply comparing WMB with java server in standalone machine(not cluster), my understanding is something
admin server = ??
managed server = broker instance
execution group == ??
application == bar file(actual message flows) |
Don't try and set your parallel. There really isn't any.
Suffice to know that the integration servers are dependent on the integration node, and that each integration server has it's own JVM.
Beyond that there is no parallel. Especially with what you can deploy and how you should write your java for the JCN.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 25, 2015 5:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The first thing to remember is that IIB is NOT a JEE server. |
|
Back to top |
|
 |
srk31 |
Posted: Fri Jun 26, 2015 9:16 am Post subject: |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
Thanks Jeff and Saper. I was going thru the documentation in the info center.
I was trying to understand the concepts.
if execution group/dataflow engine is a separate process, where we can deploy our message flows as bar which contains routing,transformation and integration happens, then what exactly broker run time will do.
i believe if we are deploying bar files in execution group, then it should have some functionality which is different from broker functionality.
is it possible to deploy directly into broker instead of execution group. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 26, 2015 9:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
No. You can't deploy to the broker. It doesn't run code.
It monitors the EGs, and associated processes. It accepts and stores configuration data. It starts and stops EG processes.
The only thing that can run message flows is an EG. End of story. |
|
Back to top |
|
 |
srk31 |
Posted: Fri Jun 26, 2015 11:55 am Post subject: |
|
|
Apprentice
Joined: 01 Sep 2010 Posts: 39
|
Thanks Jeff.
Currently, webservices implementation in wmb uses Axis framework . is there any option to change cxf framework. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 26, 2015 12:09 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
srk31 wrote: |
Currently, webservices implementation in wmb uses Axis framework . is there any option to change cxf framework. |
What's the point? You would not have access to the framework itself as it all happens behind the scenes in the IBM delivered nodes... and you are not going to change the code of those... So one framework is just as good as the other... The only code parts that could be reused would be object assignments in JAXB...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|