You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Mukesh Mediratta <me...@mail.nih.gov> on 2006/08/18 05:53:35 UTC

Multiple Destinations

We have a need to invoke multiple destinations from a Pojo.

Pojo has to act as a controller and invoke these individual services
sequentially. Based on the success/fail of an individual service the call is
made to the next service.

Please advice how to impliment this.

Thanks
Mukesh Mediratta
-- 
View this message in context: http://www.nabble.com/Multiple-Destinations-tf2124329.html#a5860791
Sent from the ServiceMix - User forum at Nabble.com.


Re: Multiple Destinations

Posted by Guillaume Nodet <gn...@gmail.com>.
You will have to create your own component.
On this component, you could configure the service names
as properties.

  <bean ...>
     <property name="service1" value="ns:service1" />
    <property name="service2" value="ns:service2" />
  </bean>

Then from the component, just set the destination before sending
the exchange.
    InOut me = createInOutExchange();
    me.setService(service1);
    send(me)

Take a look at the configuration for the EIP:
   http://servicemix.goopen.org/site/servicemix-eip.html#servicemix-eip-StaticRoutingSlip


On 8/18/06, Mukesh Mediratta <me...@mail.nih.gov> wrote:
>
> Thanks Guillaume,
>
> Here is the use case... we want to exposes a Pojo as a web service over
> HTTP.. first step for this is to authenticate and the second is
> authorization. Authentication and Authorization being available as
> individual services on ServiceMix.
>
> I looked at the configuration given in example POJO Component
>
>       <sm:activationSpec componentName="sender" service="foo:sender"
> destinationService="foo:receiver">
>         <sm:component><bean
> class="org.apache.servicemix.components.pojo.MySender" /></sm:component>
>       </sm:activationSpec>
>
> It looks like we can only have one destination configured...
>
> Is there  a way to configure more than one destination.. and how to make
> sure that we get the result back from the first call and based on that we
> make the second call.
>
> Please advice.
>
> Thanks
> Mukesh
>
>
>
> gnodet wrote:
> >
> > First, you may want to check the EIP routing slip pattern, which may help
> > you.
> >
> > If you need to insert business logic between calls that can not easily
> > be implement
> > as a service between calls, you can implement a lightweight component or
> > write
> > a simple POJO that you could deploy on servicemix-jsr181 component
> > (this component
> > can also provides java proxies to JBI endpoints).
> >
> > See
> >     http://servicemix.goopen.org/site/pojo-support.html
> >     http://servicemix.goopen.org/site/servicemix-jsr181.html
> >
> > On 8/18/06, Mukesh Mediratta <me...@mail.nih.gov> wrote:
> >>
> >> We have a need to invoke multiple destinations from a Pojo.
> >>
> >> Pojo has to act as a controller and invoke these individual services
> >> sequentially. Based on the success/fail of an individual service the call
> >> is
> >> made to the next service.
> >>
> >> Please advice how to impliment this.
> >>
> >> Thanks
> >> Mukesh Mediratta
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Multiple-Destinations-tf2124329.html#a5860791
> >> Sent from the ServiceMix - User forum at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Multiple-Destinations-tf2124329.html#a5872082
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: Multiple Destinations

Posted by Mukesh Mediratta <me...@mail.nih.gov>.
Thanks Guillaume,

Here is the use case... we want to exposes a Pojo as a web service over
HTTP.. first step for this is to authenticate and the second is
authorization. Authentication and Authorization being available as
individual services on ServiceMix.

I looked at the configuration given in example POJO Component

      <sm:activationSpec componentName="sender" service="foo:sender"
destinationService="foo:receiver">
      	<sm:component><bean
class="org.apache.servicemix.components.pojo.MySender" /></sm:component>
      </sm:activationSpec>

It looks like we can only have one destination configured... 

Is there  a way to configure more than one destination.. and how to make
sure that we get the result back from the first call and based on that we
make the second call.

Please advice.

Thanks
Mukesh



gnodet wrote:
> 
> First, you may want to check the EIP routing slip pattern, which may help
> you.
> 
> If you need to insert business logic between calls that can not easily
> be implement
> as a service between calls, you can implement a lightweight component or
> write
> a simple POJO that you could deploy on servicemix-jsr181 component
> (this component
> can also provides java proxies to JBI endpoints).
> 
> See
>     http://servicemix.goopen.org/site/pojo-support.html
>     http://servicemix.goopen.org/site/servicemix-jsr181.html
> 
> On 8/18/06, Mukesh Mediratta <me...@mail.nih.gov> wrote:
>>
>> We have a need to invoke multiple destinations from a Pojo.
>>
>> Pojo has to act as a controller and invoke these individual services
>> sequentially. Based on the success/fail of an individual service the call
>> is
>> made to the next service.
>>
>> Please advice how to impliment this.
>>
>> Thanks
>> Mukesh Mediratta
>> --
>> View this message in context:
>> http://www.nabble.com/Multiple-Destinations-tf2124329.html#a5860791
>> Sent from the ServiceMix - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-Destinations-tf2124329.html#a5872082
Sent from the ServiceMix - User forum at Nabble.com.


Re: Multiple Destinations

Posted by Guillaume Nodet <gn...@gmail.com>.
First, you may want to check the EIP routing slip pattern, which may help you.

If you need to insert business logic between calls that can not easily
be implement
as a service between calls, you can implement a lightweight component or write
a simple POJO that you could deploy on servicemix-jsr181 component
(this component
can also provides java proxies to JBI endpoints).

See
    http://servicemix.goopen.org/site/pojo-support.html
    http://servicemix.goopen.org/site/servicemix-jsr181.html

On 8/18/06, Mukesh Mediratta <me...@mail.nih.gov> wrote:
>
> We have a need to invoke multiple destinations from a Pojo.
>
> Pojo has to act as a controller and invoke these individual services
> sequentially. Based on the success/fail of an individual service the call is
> made to the next service.
>
> Please advice how to impliment this.
>
> Thanks
> Mukesh Mediratta
> --
> View this message in context: http://www.nabble.com/Multiple-Destinations-tf2124329.html#a5860791
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet