Eduardo,
Thanks. This was mentioned in the samples. I will try this out. But my main
intention was to route to other components using configuration rather than
code.
It is not the case of just this one service. I have other components that
execute business logic that I want to expose as a web service on the bus.
So in that case, I would code in each service to route to the next component
whereas I wanted to manage this through configuration i.e. using servicemix
routing mechanism.
I know there is bpel to route between web services but here are the issues I
have with bpel:
1. I will have to create a wsdl for each of my business components
2. How do I route from my bpel to other non-web service components?
Can we not use pipeline or something to route between services?
Or should I convert all of my business components as POJOs that implement
the JBI methods to be able to route to them?
Vinod.
eburgos wrote:
>
> Hi,
>
> I also had this problem, I hope there will be soon a better way to do this
> but i will explain how I am doing it currently.
>
> routing from jsr181 to the rest of servicemix:
>
> I deployed a pojo jsr181 endpoint.
>
> <jsr181:endpoint ... >
> <jsr181:pojo>
> <bean class="com.test.TestWebService">
> <property name="myProperty">
> <ref bean="myBean" />
> </property>
> </bean>
> </jsr181:pojo>
> </jsr181:endpoint>
>
>
> fortunately, the jsr181 component code injects your JBI component context
> if
> you have a ComponentContext property in your pojo declared, something like
> this:
>
>
> private ComponentContext context;
>
> @WebMethod(exclude = true)
> public ComponentContext getContext() {
> return context;
> }
>
> @WebMethod(exclude = true)
> public void setContext(ComponentContext context) {
> this.context = context;
> }
>
>
> Im not sure if you need the property accessor methods but I have them.
> Now, if you know where is your message going to forward to (i.e. if you
> know
> where is located your business component ) then you can proceed and use
> the
> context to deliver the message. Something like this:
>
>
> protected void forward(NormalizedMessage msg) {
> EndpointDeliveryChannel channel;
>
> try {
> channel = (EndpointDeliveryChannel) context.getDeliveryChannel();
>
> ServiceEndpoint se = context.getEndpoint( new QName("foo:test"),
> "myEndpoint");
>
> InOnly exch = channel.createExchangeFactory(se)
> .createInOnlyExchange();
>
>
> exch.setInMessage(msg);
>
> context.getDeliveryChannel().send(exch);
> }
>
> } catch (MessagingException e) {
>
> e.printStackTrace();
> } catch (NamingException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> }
>
>
>
> with that method you can manually create your NormalizedMessage and send
> it
> to the deliverychannel to the service you specify. Note that this approach
> doesnt involve any security at all (i.e. you might have chained your
> jsr181
> endpoint with a servicemix-http endpoint. If you have done this and you
> need
> any info such as username/password, you will find that with
> JBIContext.getMessageExchange() )
>
> reply if you have any issues or if this didn't work at all :)
>
>
>
>
>
> Eduardo Burgos
>
>
> On 2/19/07, Vinod Chhabria <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I have a need to create a flow by routing through various components of
>> servicemix. Please guide me.
>>
>> Here are my requirements:
>>
>> 1. A web service is exposed for clients.
>>
>> 2. This web service is the starting point of the flow.
>>
>> 3. From this web service I need to call another business component
>> / service that does some validation
>>
>> 4. Then another business component / service that executes some
>> business logic
>>
>> 5. Then there is a router to be called that conditionally routes to
>> different transformation components.
>>
>> 6. After the transformation component a web service of an external
>> application needs to be invoked.
>>
>> 7. The response of this web service then needs to be transformed
>> and sent back as a response to the client that invoked our web service
>> that was invoked.
>>
>>
>>
>> I need to understand how to configure this flow.
>>
>> 1. Do I expose the business components as web services using
>> servicemix-jsr181?
>>
>> 2. If yes, but from one servicemix-jsr181 component how do I route
>> to another servicemix-jsr181 without calling it in the code?
>>
>> 3. I know bpel is used for web services orchestration, but can I
>> use it to orchestrate part of my flow i.e. I use bpel only to
>> orchestrate the first 3 services and then I use some routing component
>> to route to other transformation components further on?
>>
>>
>>
>> Regards,
>>
>> Vinod.
>>
>> <http://dataexchange.sterlingtesting.com/images/sigs/image001.gif>
>>
>> <http://dataexchange.sterlingtesting.com/images/sigs/image000.gif>
>>
>> Vinod H. Chhabria :: Senior Developer, Integration Services
>> Sterling Testing Systems :: 249 West 17th Street :: 6th Floor :: New
>> York :: NY :: 10011
>> 646-435-2208 (t) :: 646-435-2281 (f)
>> www.sterlingtesting.com <http://www.sterlingtesting.com>
>>
>>
>>
>>
>> This email (and any attachments) is intended only for the use of the
>> individual or entity named above and may contain information that is
>> privileged and confidential. If you are not the intended recipient, or
>> have
>> unauthorized access, you are hereby notified that copying, disseminating,
>> distributing or taking any action in reliance on this email is strictly
>> prohibited<br />
>>
>> Opinions, conclusions and other information in this message that do not
>> relate to the official business of our firm shall be understood as
>> neither
>> given nor endorsed by it.
>>
>
>
--
View this message in context:
http://www.nabble.com/servicemix-routing-question-tf3256020s12049.html#a9065106
Sent from the ServiceMix - User mailing list archive at Nabble.com.