-
30. Re: Problems with delivering the request message sysnchronou
kurtstam Jun 14, 2007 8:03 AM (in response to andre1001)So is this the wiretap the same implementation as the wiretap QS? Note that there is no such thing as a WireTapAction right now. It's more the way you set up routers.
--Kurt -
31. Re: Problems with delivering the request message sysnchronou
marklittle Jun 14, 2007 8:11 AM (in response to andre1001)Guys, let's take this discussion to a separate entry on the design forum. It's getting difficult for readers to figure out precisely what this trail is about now: the title no longer does it justice. Thanks.
-
32. Re: Problems with delivering the request message sysnchronou
kconner Jun 14, 2007 8:31 AM (in response to andre1001)Continued in development forum http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054327#4054327
-
33. Re: Problems with delivering the request message sysnchronou
claudio_br Jun 14, 2007 2:39 PM (in response to andre1001)Hi Kevin,
I´ve got the last version of trunk and run my test code (webservice > StaticRouter > MyService). But I´ve got again same problem.
What can I do to work it out?
Thanks -
34. Re: Problems with delivering the request message sysnchronou
kconner Jun 14, 2007 4:06 PM (in response to andre1001)Sorry but I haven't committed a fix for the static router issue, something else came up. I'll get the fix in first thing tomorrow morning.
The workaround I suggested earlier will work now that JBESB-625 is fixed. -
35. Re: Problems with delivering the request message sysnchronou
claudio_br Jun 14, 2007 5:08 PM (in response to andre1001)Hi Kevin,
I modified my test code to add fix:
jboss-esb.xml<?xml version = "1.0" encoding = "UTF-8"?> <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5"> <providers> <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost" > <jms-bus busid="quickstartEsbChannel"> <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_war1_esb" /> </jms-bus> <jms-bus busid="quickstartEsbChannel2"> <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_war1_esb_2" /> </jms-bus> </jms-provider> </providers> <services> <service category="MyServiceCategory" name="MyService" description="WS Frontend speaks natively to the ESB" > <listeners> <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" maxThreads="1" /> </listeners> <actions> <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter"> <property name="destinations"> <route-to service-category="MyServiceCategory" service-name="MyService2" /> </property> </action> <action name="fix" class="org.jboss.soa.esb.samples.quickstart.webservicewar1.MyAction" process="nulo"/> </actions> </service> <service category="MyServiceCategory" name="MyService2" description="WS Frontend speaks natively to the ESB" > <listeners> <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel2" maxThreads="1" /> </listeners> <actions> <action name="displayAction" class="org.jboss.soa.esb.samples.quickstart.webservicewar1.MyAction" process="displayMessage"> <property name="exceptionMethod" value="exceptionHandler"/> </action> <action name="playAction" class="org.jboss.soa.esb.samples.quickstart.webservicewar1.MyAction" process="playWithMessage"> <property name="exceptionMethod" value="exceptionHandler"/> </action> <action name="displayAction" class="org.jboss.soa.esb.samples.quickstart.webservicewar1.MyAction" process="displayMessage"> <property name="exceptionMethod" value="exceptionHandler"/> </action> </actions> </service> </services> </jbossesb>
And added method nulo in org.jboss.soa.esb.samples.quickstart.webservicewar1.MyActionpublic Message nulo(Message message) throws Exception { return null; }
But I got the exception:17:51:00,343 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline org.jboss.soa.esb.actions.ActionProcessingException: Unexpected response type from processor: null at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.process Methods(ActionProcessorMethodInfo.java:109) at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:253) at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595)
Have I missed something? -
36. Re: Problems with delivering the request message sysnchronou
kconner Jun 15, 2007 5:12 AM (in response to andre1001)Sorry, will get that one fixed.
In the meantime create a separate action as followspublic class MyAction2 extends AbstractActionPipelineProcessor { public MyAction2(final ConfigTree config) { } public Message process(final Message message) throws ActionProcessingException { return null; } }
-
37. Re: Problems with delivering the request message sysnchronou
claudio_br Jun 15, 2007 10:16 AM (in response to andre1001)Hi Kevin,
I had created this method (nulo) in last post.
But I didn´t make me clear.
My complete code is:/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and others contributors as indicated * by the @authors tag. All rights reserved. * See the copyright.txt in the distribution for a * full listing of individual contributors. * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU Lesser General Public License, v. 2.1. * This program is distributed in the hope that it will be useful, but WITHOUT A * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License, * v.2.1 along with this distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * (C) 2005-2006, * @author JBoss Inc. */ package org.jboss.soa.esb.samples.quickstart.webservicewar1; import org.jboss.soa.esb.helpers.ConfigTree; import org.jboss.soa.esb.message.Body; import org.jboss.soa.esb.message.Message; import org.jboss.soa.esb.message.format.MessageFactory; import org.jboss.soa.esb.message.format.MessageType; import org.jboss.soa.esb.actions.AbstractActionLifecycle; import org.jboss.soa.esb.addressing.EPR; import org.jboss.soa.esb.couriers.Courier; import org.jboss.soa.esb.couriers.CourierFactory; import org.jboss.soa.esb.couriers.CourierUtil; public class MyAction extends AbstractActionLifecycle { protected ConfigTree _config; public MyAction(ConfigTree config) { _config = config; } public Message noOperation(Message message) { return message; } public Message nulo(Message message) throws Exception { return null; } public Message displayMessage(Message message) throws Exception { logHeader(); System.out.println("Body: " + new String(message.getBody().getByteArray())); logFooter(); return message; } public Message playWithMessage(Message message) throws Exception { Body msgBody = message.getBody(); String contents = new String(msgBody.getByteArray()); // Reset the message body contents with the response... msgBody.setByteArray(("Hello From ESB MyAction: " + contents).getBytes()); return message; } public void exceptionHandler(Message message, Throwable exception) { logHeader(); System.out.println("!ERROR!"); System.out.println(exception.getMessage()); System.out.println("For Message: "); System.out.println(message.getBody().getByteArray()); logFooter(); } // This makes it easier to read on the console private void logHeader() { System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"); } private void logFooter() { System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n"); } }
-
38. Re: Problems with delivering the request message sysnchronou
kconner Jun 15, 2007 12:17 PM (in response to andre1001)Hiya Claudio.
I realised what you had done but I suggested different code to work around your issue with ActionProcessorMethodInfo. ActionProcessorMethodInfo is an adapter class which wraps any action accessed via reflection.
All issues have now been fixed though, you should be able to update the code and run your test again. The nulo method will no longer be necessary.
BTW The jira for the adapter error is http://jira.jboss.com/jira/browse/JBESB-627 -
39. Re: Problems with delivering the request message sysnchronou
andre1001 Jun 15, 2007 2:10 PM (in response to andre1001)"Kevin.Conner@jboss.com" wrote:
I have raised a JIRA issue to check all the actions we currently support, <a href='http://jira.jboss.com/jira/browse/JBESB-624'>http://jira.jboss.com/jira/browse/JBESB-624</a>
Hi Kevin,
The second issue (send back the requested message) was solved for all components.
The first issue (Correlation Id) still happens with ContentBasedRouter action.
Thanks. -
40. Re: Problems with delivering the request message sysnchronou
kconner Jun 15, 2007 2:29 PM (in response to andre1001)"Andre1001" wrote:
The first issue (Correlation Id) still happens with ContentBasedRouter action.
Can you send me your .esb archive via email? -
41. Re: Problems with delivering the request message sysnchronou
claudio_br Jun 15, 2007 4:34 PM (in response to andre1001)Hi Kevin,
I sended the example via email.
You can testing this esb with this client:package com.cla; //For ESB Interaction import org.jboss.soa.esb.message.Message; // jbossesb-rosetta.jar import org.jboss.soa.esb.message.format.MessageFactory; // jbossesb-rosetta.jar import org.jboss.soa.esb.message.format.MessageType; // jbossesb-rosetta.jar import org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter; // jbossesb-rosetta.jar public class Teste { public static void main(String[] args) throws Exception{ EnderecoBean resp = null; // Cachear delivery adapter para o servico MessageDeliveryAdapter deliveryAdapter = new MessageDeliveryAdapter("Empresa", "Endereco"); // Cachear o factory de mensagens MessageFactory mfactory = MessageFactory.getInstance(); Message requestMessage; Message replyMessage = null ; // Create and populate the request message... requestMessage = mfactory.getMessage(MessageType.JBOSS_XML); //Modificar para adicionar o comando no Body //requestMessage.getProperties().setProperty("Comando","apagar"); EnderecoBean e = new EnderecoBean(); String nome = Long.toString(System.currentTimeMillis()); e.setId(30); e.setName("Empresa teste "+nome); System.out.println("in id: "+e.getId()); System.out.println("in name: "+e.getName()); System.out.println("---------------------------------------"); Comando cmd = new Comando(); cmd.setValor("gravar"); requestMessage.getBody().add("Comando",cmd); requestMessage.getBody().add("empresa",e); // Deliver the request message synchronously - timeout after 5 seconds... replyMessage = deliveryAdapter.deliverSync(requestMessage, 5000); resp = (EnderecoBean)replyMessage.getBody().get("empresa"); System.out.println("out id: "+resp.getId()); System.out.println("out name: "+resp.getName()); } }
I got:
in id: 30
in name: Empresa teste 1181938992250
---------------------------------------
out id: 30
out name: Empresa teste 1181937750031 gravar
But the correct answer should be:
in id: 30
in name: Empresa teste 1181938992250
---------------------------------------
out id: 30
out name: Empresa teste 1181938992250 gravar
This seems to relate to with a first problem (CorrelactioID).
Thanks -
42. Re: Problems with delivering the request message sysnchronou
claudio_br Jun 15, 2007 5:21 PM (in response to andre1001)Hi Kevin,
The problem occur in multithread or if exist a message hold in table JMS_MESSAGES -
43. Re: Problems with delivering the request message sysnchronou
kconner Jun 18, 2007 6:23 AM (in response to andre1001)Hiya Claudio.
I have been running a multi threaded test for some time and have yet to see it fail in the manner you describe.
I have seen other errors, notably when accessing the registry, but the response message always corresponded to the request message.
Can you please check the jar files being used by your client and make sure that they are up to date?
Thanks -
44. Re: Problems with delivering the request message sysnchronou
kconner Jun 18, 2007 6:59 AM (in response to andre1001)Claudio/Andre.
I have moved this discussion to a new topic, can you follow up on the new one?
The new topic is http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055152#4055152