You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Tak <yo...@gmail.com> on 2006/08/11 19:31:16 UTC

How to access lwcontainer component from jsr181 component?

I would like to invoke InOnly MEP service from my jsr181 components.
According to this forum, jsr-181 component cannot call
DeliveryChannel.sunc() method.
So I am trying to make a lwcontainer proxy component that receives message
from serviceA's DeliveryChannel.sendSync(), and DeliveryChannel.send() it to
target serviceB which expects InOnly MEP.

My quesiton is
How to configure lwcontainer component to access it from my code in jsr181
component?
I am using DeliveryChannel.sendSync() method, and my lw components never get
called and sendSync call is blocked. It seems like it's waiting timeout.

I have tried find out the example, but only configuration wirings,
destinationService="someservice",  are found.
Could someone please point me out what should I do for this?

What I did is:
I have setup my lwcontainer component in servicemix.xml as below:
<sm:serviceunit id="jbi">
    <sm:activationSpec componentName="asyncjmssender"
                       service="ns:AsyncJmsSender"
                       endpoint="AsyncJmsSender">
      <sm:component>
        <bean class="blah.blah.AsyncJmsSender">
        </bean>
      </sm:component>
    </sm:activationSpec>
  </sm:activationSpecs>
</sm:serviceunit>

and expose this lw component via servicemix-jms component as
<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.asyncsender"
  connectionFactory="#jmsFactory"/>

<jms:endpoint
  service="im:AsyncJmsSenderProviderService"
  endpoint="AsyncJmsSenderProviderService"
  role="provider"
  destinationStyle="queue"
 jmsProviderDestinationName="queue.asyncsender"
  connectionFactory="#jmsFactory"/>




-- 
View this message in context: http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5766361
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to access lwcontainer component from jsr181 component?

Posted by Tak <yo...@gmail.com>.

Sorry, I forgot to add one thing.

I have checked queue "queue.master.itemmanagement.americas.v1.asyncsender"
through jconsole, and the message was populated.
My poor guess is, AsyncJmsSenderProviderService BC successfully worked, 
but AsyncJmsSenderConsumerService failed to dispatch the message to its
target service "AsyncJmsSender".

-------------------
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#a5781049
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to access lwcontainer component from jsr181 component?

Posted by Guillaume Nodet <gn...@gmail.com>.
Could you raise a JIRA and attach your SA ?

On 8/21/06, Tak <yo...@gmail.com> wrote:
>
>
> Does someone has any idea about my case?
>
> And is the way I am doing right?,  which is
> configured jms BC for lwcontainer component, and access it from JSR181 via
> DliveryChannel.sendSync().
>
> Any comments would be really appreciated.
> Tak
>
> >>On the jms consumer endpoint, you have to define the
> >>defaultMep="http://www.w3.org/2004/08/wsdl/in-out" attribute.
> >>Failing this, you should have in your log an exception:
> >>javax.jbi.messaging.MessagingException: Do not understand pattern: null
> >>
> >I think my definition have this, as I posted,
> >and I didn't have any exception messagae in log output.
> >
> >>>   <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"/>
> --
> View this message in context: http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5900231
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: How to access lwcontainer component from jsr181 component?

Posted by Tak <yo...@gmail.com>.

Does someone has any idea about my case?

And is the way I am doing right?,  which is
configured jms BC for lwcontainer component, and access it from JSR181 via
DliveryChannel.sendSync().

Any comments would be really appreciated.
Tak

>>On the jms consumer endpoint, you have to define the
>>defaultMep="http://www.w3.org/2004/08/wsdl/in-out" attribute.
>>Failing this, you should have in your log an exception:
>>javax.jbi.messaging.MessagingException: Do not understand pattern: null
>>
>I think my definition have this, as I posted,
>and I didn't have any exception messagae in log output.
>
>>>   <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"/> 
-- 
View this message in context: http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5900231
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to access lwcontainer component from jsr181 component?

Posted by Tak <yo...@gmail.com>.
>On the jms consumer endpoint, you have to define the
>defaultMep="http://www.w3.org/2004/08/wsdl/in-out" attribute.
>Failing this, you should have in your log an exception:
>javax.jbi.messaging.MessagingException: Do not understand pattern: null
>
I think my definition have this, as I posted,
and I didn't have any exception messagae in log output.

>>   <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"/> 
-- 
View this message in context: http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5784783
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to access lwcontainer component from jsr181 component?

Posted by Guillaume Nodet <gn...@gmail.com>.
On the jms consumer endpoint, you have to define the
                               defaultMep="
http://www.w3.org/2004/08/wsdl/in-out"
attribute.
Failing this, you should have in your log an exception:
       javax.jbi.messaging.MessagingException: Do not understand pattern:
null

I will add a check to ensure this mandatory attribute has been configured.

On 8/13/06, Tak <yo...@gmail.com> wrote:
>
>
> 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.
>
>


-- 
Cheers,
Guillaume Nodet

Re: How to access lwcontainer component from jsr181 component?

Posted by Tak <yo...@gmail.com>.
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.


Re: How to access lwcontainer component from jsr181 component?

Posted by Guillaume Nodet <gn...@gmail.com>.
Sorry i misunderstood you.
I really don't see any reason why this would not work.
Which lightweight component do you use ?
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).

On 8/13/06, Tak <yo...@gmail.com> wrote:
>
>
> My applogy that my original email didn't point out my issue clearly.
>
> >You can send JBI exchanges from the jsr181 component.
> >See
>
> http://servicemix.goopen.org/site/servicemix-jsr181.html#servicemix-jsr181-AccessingtheJBIbus
> >The only limitation is that you can not use DeliveryChannel.send() and
> you
> have to use DeliveryChannel.sendSync().
> >
> DeliveryChannel.sendSync() is working fine between jsr181 components via
> both servicemix-http and servicemix-jms BC.
> My quesiton is how to DeliveryChannel.sendSync() from jsr181 component to
> lwcontainer component, or my BC approach may not be right.
>
> I understand lwcontainer component is SE, so I need BC to access it.
> So I have tried to set up servicemix-http and servicemix-jms BCs to
> lwcontainer component as I did for jsr181 component,
> but it doesn't work as I reported. It looks like the exchange didn't reach
> to the lwcontainer component.
> There is no error, and the call is blocked until the timeout has happened.
>
> Could you please point out what wrong with this approach?
>
> >If you want to use send(), you could create a full client.
> >See
>
> http://servicemix.goopen.org/site/client-api.html#ClientAPI-UsingClientFactory
> >
> Thanks, I will try this.
> Even though my goal is JBI container neutral like J2EE (no servicemix
> specific code in my POJO), this could be a work around.
>
> Thanks,
> Tak
>
> >On 8/11/06, Tak <yo...@gmail.com> wrote:
> >> What I did is:
> >> I have setup my lwcontainer component in servicemix.xml as below:
> >> <sm:serviceunit id="jbi">
> >>     <sm:activationSpec componentName="asyncjmssender"
> >>                        service="ns:AsyncJmsSender"
> >>                        endpoint="AsyncJmsSender">
> >>       <sm:component>
> >>         <bean class="blah.blah.AsyncJmsSender">
> >>         </bean>
> >>       </sm:component>
> >>     </sm:activationSpec>
> >>   </sm:activationSpecs>
> >> </sm:serviceunit>
> >>
> >> and expose this lw component via servicemix-jms component as
> >> <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.asyncsender"
> >>   connectionFactory="#jmsFactory"/>
> >>
> >> <jms:endpoint
> >>   service="im:AsyncJmsSenderProviderService"
> >>   endpoint="AsyncJmsSenderProviderService"
> >>   role="provider"
> >>   destinationStyle="queue"
> >> jmsProviderDestinationName="queue.asyncsender"
> >>   connectionFactory="#jmsFactory"/>
>
> --
> View this message in context:
> http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5780380
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: How to access lwcontainer component from jsr181 component?

Posted by Tak <yo...@gmail.com>.
My applogy that my original email didn't point out my issue clearly.

>You can send JBI exchanges from the jsr181 component.
>See
http://servicemix.goopen.org/site/servicemix-jsr181.html#servicemix-jsr181-AccessingtheJBIbus
>The only limitation is that you can not use DeliveryChannel.send() and you
have to use DeliveryChannel.sendSync().
>
DeliveryChannel.sendSync() is working fine between jsr181 components via
both servicemix-http and servicemix-jms BC.
My quesiton is how to DeliveryChannel.sendSync() from jsr181 component to
lwcontainer component, or my BC approach may not be right.

I understand lwcontainer component is SE, so I need BC to access it.
So I have tried to set up servicemix-http and servicemix-jms BCs to
lwcontainer component as I did for jsr181 component,
but it doesn't work as I reported. It looks like the exchange didn't reach
to the lwcontainer component.
There is no error, and the call is blocked until the timeout has happened.

Could you please point out what wrong with this approach?

>If you want to use send(), you could create a full client.
>See
http://servicemix.goopen.org/site/client-api.html#ClientAPI-UsingClientFactory
>
Thanks, I will try this.
Even though my goal is JBI container neutral like J2EE (no servicemix
specific code in my POJO), this could be a work around.

Thanks,
Tak

>On 8/11/06, Tak <yo...@gmail.com> wrote:
>> What I did is:
>> I have setup my lwcontainer component in servicemix.xml as below:
>> <sm:serviceunit id="jbi">
>>     <sm:activationSpec componentName="asyncjmssender"
>>                        service="ns:AsyncJmsSender"
>>                        endpoint="AsyncJmsSender">
>>       <sm:component>
>>         <bean class="blah.blah.AsyncJmsSender">
>>         </bean>
>>       </sm:component>
>>     </sm:activationSpec>
>>   </sm:activationSpecs>
>> </sm:serviceunit>
>>
>> and expose this lw component via servicemix-jms component as
>> <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.asyncsender"
>>   connectionFactory="#jmsFactory"/>
>>
>> <jms:endpoint
>>   service="im:AsyncJmsSenderProviderService"
>>   endpoint="AsyncJmsSenderProviderService"
>>   role="provider"
>>   destinationStyle="queue"
>> jmsProviderDestinationName="queue.asyncsender"
>>   connectionFactory="#jmsFactory"/>

-- 
View this message in context: http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5780380
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to access lwcontainer component from jsr181 component?

Posted by Guillaume Nodet <gn...@gmail.com>.
You can send JBI exchanges from the jsr181 component.
See
http://servicemix.goopen.org/site/servicemix-jsr181.html#servicemix-jsr181-AccessingtheJBIbus
The only limitation is that you can not use DeliveryChannel.send() and you
have to use
DeliveryChannel.sendSync().
If you want to use send(), you could create a full client.
See
http://servicemix.goopen.org/site/client-api.html#ClientAPI-UsingClientFactory

On 8/11/06, Tak <yo...@gmail.com> wrote:
>
>
> I would like to invoke InOnly MEP service from my jsr181 components.
> According to this forum, jsr-181 component cannot call
> DeliveryChannel.sunc() method.
> So I am trying to make a lwcontainer proxy component that receives message
> from serviceA's DeliveryChannel.sendSync(), and DeliveryChannel.send() it
> to
> target serviceB which expects InOnly MEP.
>
> My quesiton is
> How to configure lwcontainer component to access it from my code in jsr181
> component?
> I am using DeliveryChannel.sendSync() method, and my lw components never
> get
> called and sendSync call is blocked. It seems like it's waiting timeout.
>
> I have tried find out the example, but only configuration wirings,
> destinationService="someservice",  are found.
> Could someone please point me out what should I do for this?
>
> What I did is:
> I have setup my lwcontainer component in servicemix.xml as below:
> <sm:serviceunit id="jbi">
>     <sm:activationSpec componentName="asyncjmssender"
>                        service="ns:AsyncJmsSender"
>                        endpoint="AsyncJmsSender">
>       <sm:component>
>         <bean class="blah.blah.AsyncJmsSender">
>         </bean>
>       </sm:component>
>     </sm:activationSpec>
>   </sm:activationSpecs>
> </sm:serviceunit>
>
> and expose this lw component via servicemix-jms component as
> <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.asyncsender"
>   connectionFactory="#jmsFactory"/>
>
> <jms:endpoint
>   service="im:AsyncJmsSenderProviderService"
>   endpoint="AsyncJmsSenderProviderService"
>   role="provider"
>   destinationStyle="queue"
> jmsProviderDestinationName="queue.asyncsender"
>   connectionFactory="#jmsFactory"/>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/How-to-access-lwcontainer-component-from-jsr181-component--tf2091924.html#a5766361
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet