Thanks for your quick response.
>I really don't see any reason why this would not work.
>Which lightweight component do you use ?
>
This will become a bit longer, but here is what I did.
-- my lwcontainer component class --
public class AsyncJmsSender
implements MessageExchangeListener
{
public void onMessageExchange(MessageExchange exchange) throws
MessagingException
{
System.err.println("AsyncJmsSender.onMessageExchange...");
// nothing has been implemented yet.
}
}
This class implemented nothing, but even this stderr message did not come
out.
-- lwcontainer servicemix.xml --
<?xml version="1.0"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:ns="http://v1.americas.itemmanagement.master.optionzero.sf.net">
<classpath>
<location>.</location>
</classpath>
<sm:serviceunit id="jbi">
<sm:activationSpecs>
<sm:activationSpec componentName="asyncjmssender"
service="ns:AsyncJmsSender"
endpoint="AsyncJmsSender">
<sm:component>
<bean
class="net.sf.optionzero.master.itemmanagement.americas.v1.impl.AsyncJmsSender"/>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:serviceunit>
</beans>
-- jms BC xbean.xml for lwconponent --
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
xmlns:im="http://v1.americas.itemmanagement.master.optionzero.sf.net">
<jms:endpoint
service="im:AsyncJmsSenderConsumerService"
endpoint="AsyncJmsSenderConsumerService"
targetService="im:AsyncJmsSender"
targetEndpoint="AsyncJmsSender"
role="consumer"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
destinationStyle="queue"
jmsProviderDestinationName="queue.master.itemmanagement.americas.v1.asyncsender"
connectionFactory="#jmsFactory"/>
<jms:endpoint
service="im:AsyncJmsSenderProviderService"
endpoint="AsyncJmsSenderProviderService"
role="provider"
destinationStyle="queue"
jmsProviderDestinationName="queue.master.itemmanagement.americas.v1.asyncsender"
connectionFactory="#jmsFactory"/>
<bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
</property>
</bean>
</beans>
-- snippet of jbi.xml in assembly --
<service-unit>
<identification>
<name>TestJaxwsItemmanagementSeparateNS-se-asyncer</name>
<description>TestJaxwsItemmanagementSeparateNS asyncer</description>
</identification>
<target>
<artifacts-zip>TestJaxwsItemmanagementSeparateNS-se-asyncer.jar</artifacts-zip>
<component-name>servicemix-lwcontainer</component-name>
</target>
</service-unit>
<service-unit>
<identification>
<name>TestJaxwsItemmanagementSeparateNS-bc-in-jms</name>
<description>TestJaxwsItemmanagementSeparateNS jms</description>
</identification>
<target>
<artifacts-zip>TestJaxwsItemmanagementSeparateNS-bc-in-jms.jar</artifacts-zip>
<component-name>servicemix-jms</component-name>
</target>
</service-unit>
-- snippet of POJO code in jsr181 components --
String xmlStr = ... generate xml string to send
String servieNS =
"http://v1.americas.itemmanagement.master.optionzero.sf.net";
String servieName = "AsyncJmsSenderProviderService";
QName serviceQName = new QName(serviceNS, serviceName);
// prepare a MessageExchange of the DeliveryChannel for the Service Endpoint
DeliveryChannel channel = context.getDeliveryChannel();
MessageExchangeFactory factory =
channel.createExchangeFactoryForService(serviceQName);
InOut inOutExch = factory.createInOutExchange();
NormalizedMessage reqMsg = inOutExch.createMessage();
reqMsg.setContent(new StreamSource(new StringReader(xmlStr)));
inOutExch.setInMessage(reqMsg);
// invoke service via MessageExchange
System.err.println("sendSync...");
boolean result = channel.sendSync(inOutExch);
System.out.println("... end sendSync. result=" + result);
...
>Also, see
http://servicemix.goopen.org/site/why-does-servicemix-seems-to-hang-after-some-processing.html
>The sendSync method will wait for the target component to send the exchange
back (with a DONE status for an InOnly).
>
Again, onMessageExchange method wasn't invoked.
I hope this could provide you enough information to solve this issue.
Thanks,
Tak
--
View this message in context:
http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5781005
Sent from the ServiceMix - User forum at Nabble.com.