You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by larjohn <la...@gmail.com> on 2009/01/19 19:41:34 UTC

Component to component messaging in a simple way

Hi, I am still a beginner in Servicemix so please be patient while answering
questions like mine :-P

I have two service units on top of cxf-se in the same service assemblies.
They are both copies of the wsdl-cxf example, but with different endpoints.
I see how the outter world sends messages to the cxf-se through cxf-bc or an
http, but I wonder which is the simpler way to send a message (eg a string)
from the one cxf-se to the other through the nmr. I mean what do I need to
implement in their classes? Is there a specific interface? Will they be
notified automatically for incoming messages? I have seen samples with
camel, eip and routing, but I think it can be done without them, can't it? I
don't need a complex solution, just a simple one, to say hello world from
the one cxf-se to the other, and a simple way to test that, without
unittests (where do system.out.writes go?).
Can you help me?
-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21549001.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by larjohn <la...@gmail.com>.
Sorry for leaving the disclaimer in my previous message. It's midnight here
so.... :blush:

-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21574455.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

It is possible very easily by setting the second WSDL Service Host/Port to
be localhost:xxxx and then creating and launching it in Servicemix. The
invocation from the first service would be a local invcation albeit not
using the NMR directly.

However doing this purely using the NMR is more involved and may involve an
intermediate component such as Routing Slip between the first CXF-BC and
CXF-SE to direct the payload of the first CXF-SE to the second JBI
Service/Endpoint such as an SMX-Bean.

                                          |--> CXF-SE
        CXF-BC --> Routing Slip -|        |
                                          |        v
                                          |<-- SMX-Bean (behaving as Impl
for Second Service)

The reason I chose SMX-Bean is that dynamic Invocation from within the
CXF-SE  directly without using the Routing Slip as a conduit is convoluted
and bad practise since the CXF_SE then is neither pure JBI nor a pure
JAX-WS.

In Servicemix 4.0 OSGi version there is direct access offered to the NMR and
an example of how to do so is available there. This NMR local invocation is
possible due to the Service being available as an Object that may be
registered in the OSGi registry and refered to by other services. This is
not possible in SMX 3.x

Hope this helps.

Cheers,

Ashwin...

    

melu wrote:
> 
> Hi,
> 
> Does it mean that all components have to be directly exposed to the world?
> Is it not possible to do such scenario: have one service and SU and BC and
> second service and... only SU and one want to that one service will
> communicate to these second service but second service is not exposed
> through the world and all communication between them is through NMR.
> 
> Thanks
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> Yes, you need a second CXF-BC and CXF-SU for the second service. As for
>> invoking the second service, you need to add a proxy CXF-BC producer that
>> can be invoked from the first service to invoke the second service. Ther
>> should be junit test examples for the CXF component if you do a source
>> download.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> 
>> larjohn wrote:
>>> 
>>> Thanks, It seems good to me. My problem now is the URI's for the
>>> endpoints.
>>> Suppose I have a cxf-bc SU with the following xbean:
>>> 
>>> 
>>> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
>>> 
>>>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>>>                       targetService="person:PersonService"
>>>                       targetInterface="person:Person"/>
>>> 
>>> </beans>
>>> 
>>> 
>>> Then I also have the example's cxf-se SU, with the xbean:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!--
>>>     
>>>     Licensed to the Apache Software Foundation (ASF) under one or more
>>>     contributor license agreements.  See the NOTICE file distributed
>>> with
>>>     this work for additional information regarding copyright ownership.
>>>     The ASF licenses this file to You under the Apache License, Version
>>> 2.0
>>>     (the "License"); you may not use this file except in compliance with
>>>     the License.  You may obtain a copy of the License at
>>>     
>>>     http://www.apache.org/licenses/LICENSE-2.0
>>>     
>>>     Unless required by applicable law or agreed to in writing, software
>>>     distributed under the License is distributed on an "AS IS" BASIS,
>>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>     See the License for the specific language governing permissions and
>>>     limitations under the License.
>>> 
>>> -->
>>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
>>> 
>>>     <cxfse:endpoint>
>>>         <cxfse:pojo>
>>>           <bean
>>> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>>>         </cxfse:pojo>
>>>     </cxfse:endpoint>
>>> 
>>> </beans>
>>> 
>>> 
>>> As you can see, they are directly taken from the wsdl-cxf example. The
>>> java and wsdl's are also included as they are in the example. 
>>> Now, I need to create another cxf-se to warp a pojo (is that a right
>>> approach?). The first cxf-se should request the second's service, so
>>> that it can return a specific response. That is where I get stuck! 
>>>  - Do I need another cxf-bc for the second cxf-se? 
>>>  - If I use Camel what endpoints should I enter in the from and the to
>>> strings? 
>>>  - Will the response return to the first cxf-se and when? Will it block?
>>> 
>>> 
>>> Ashwin Karpe wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I guess what you are looking for is described on the following Camel
>>>> link
>>>> 
>>>>  http://camel.apache.org/pipes-and-filters.html
>>>> http://camel.apache.org/pipes-and-filters.html 
>>>> 
>>>> Check this out. There is no need to write component code. You can use
>>>> the DSL described in the link
>>>> 
>>>> Hope this helps.
>>>> 
>>>> Cheers,
>>>> 
>>>> Ashwin...
>>>> 
>>> 
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21669141.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by larjohn <la...@gmail.com>.
There are some posts in the forums that can help you (documentation is far
from rich yet, unfortunately). I don't know why but I can't post the links
here because the address doesn't seem correct to me
(http://cwiki.apache.org/SM/discussion-forums.html). 
You can search the forums for the words servicemixclient and jndi together,
to get the posts for the servicemix client. About proxies, see my other post
(click on my name and see messages). If you need more help, you can contact
me by mail ;)



melu wrote:
> 
> Thanks for replay but could you give more details how to do that? How to
> use ServicemixClient or how to build proxies? Maybe some snippets... would
> be great... or maybe same example already exists?
> 
> 
> 
> larjohn wrote:
>> 
>> Actually, they can communicate through the NMR without extra bc's. They
>> can either use the ServicemixClient, or concerning cxf-se, they can use
>> proxies to communicate even simplier.
>> 
>> 
>> melu wrote:
>>> 
>>> Hi,
>>> 
>>> Does it mean that all components have to be directly exposed to the
>>> world? Is it not possible to do such scenario: have one service and SU
>>> and BC and second service and... only SU and one want to that one
>>> service will communicate to these second service but second service is
>>> not exposed through the world and all communication between them is
>>> through NMR.
>>> 
>>> Thanks
>>> 
>>> 
>>> 
>>> Ashwin Karpe wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> Yes, you need a second CXF-BC and CXF-SU for the second service. As for
>>>> invoking the second service, you need to add a proxy CXF-BC producer
>>>> that can be invoked from the first service to invoke the second
>>>> service. Ther should be junit test examples for the CXF component if
>>>> you do a source download.
>>>> 
>>>> Cheers,
>>>> 
>>>> Ashwin...
>>>> 
>>>> 
>>>> larjohn wrote:
>>>>> 
>>>>> Thanks, It seems good to me. My problem now is the URI's for the
>>>>> endpoints.
>>>>> Suppose I have a cxf-bc SU with the following xbean:
>>>>> 
>>>>> 
>>>>> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>>>>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
>>>>> 
>>>>>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>>>>>                       targetService="person:PersonService"
>>>>>                       targetInterface="person:Person"/>
>>>>> 
>>>>> </beans>
>>>>> 
>>>>> 
>>>>> Then I also have the example's cxf-se SU, with the xbean:
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <!--
>>>>>     
>>>>>     Licensed to the Apache Software Foundation (ASF) under one or more
>>>>>     contributor license agreements.  See the NOTICE file distributed
>>>>> with
>>>>>     this work for additional information regarding copyright
>>>>> ownership.
>>>>>     The ASF licenses this file to You under the Apache License,
>>>>> Version 2.0
>>>>>     (the "License"); you may not use this file except in compliance
>>>>> with
>>>>>     the License.  You may obtain a copy of the License at
>>>>>     
>>>>>     http://www.apache.org/licenses/LICENSE-2.0
>>>>>     
>>>>>     Unless required by applicable law or agreed to in writing,
>>>>> software
>>>>>     distributed under the License is distributed on an "AS IS" BASIS,
>>>>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>>> implied.
>>>>>     See the License for the specific language governing permissions
>>>>> and
>>>>>     limitations under the License.
>>>>> 
>>>>> -->
>>>>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
>>>>> 
>>>>>     <cxfse:endpoint>
>>>>>         <cxfse:pojo>
>>>>>           <bean
>>>>> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>>>>>         </cxfse:pojo>
>>>>>     </cxfse:endpoint>
>>>>> 
>>>>> </beans>
>>>>> 
>>>>> 
>>>>> As you can see, they are directly taken from the wsdl-cxf example. The
>>>>> java and wsdl's are also included as they are in the example. 
>>>>> Now, I need to create another cxf-se to warp a pojo (is that a right
>>>>> approach?). The first cxf-se should request the second's service, so
>>>>> that it can return a specific response. That is where I get stuck! 
>>>>>  - Do I need another cxf-bc for the second cxf-se? 
>>>>>  - If I use Camel what endpoints should I enter in the from and the to
>>>>> strings? 
>>>>>  - Will the response return to the first cxf-se and when? Will it
>>>>> block?
>>>>> 
>>>>> 
>>>>> Ashwin Karpe wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I guess what you are looking for is described on the following Camel
>>>>>> link
>>>>>> 
>>>>>>  http://camel.apache.org/pipes-and-filters.html
>>>>>> http://camel.apache.org/pipes-and-filters.html 
>>>>>> 
>>>>>> Check this out. There is no need to write component code. You can use
>>>>>> the DSL described in the link
>>>>>> 
>>>>>> Hope this helps.
>>>>>> 
>>>>>> Cheers,
>>>>>> 
>>>>>> Ashwin...
>>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21663466.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by melu <ml...@gmail.com>.
Thanks for replay but could you give more details how to do that? How to use
ServicemixClient or how to build proxies? Maybe some snippets... would be
great... or maybe same example already exists?



larjohn wrote:
> 
> Actually, they can communicate through the NMR without extra bc's. They
> can either use the ServicemixClient, or concerning cxf-se, they can use
> proxies to communicate even simplier.
> 
> 
> melu wrote:
>> 
>> Hi,
>> 
>> Does it mean that all components have to be directly exposed to the
>> world? Is it not possible to do such scenario: have one service and SU
>> and BC and second service and... only SU and one want to that one service
>> will communicate to these second service but second service is not
>> exposed through the world and all communication between them is through
>> NMR.
>> 
>> Thanks
>> 
>> 
>> 
>> Ashwin Karpe wrote:
>>> 
>>> Hi,
>>> 
>>> Yes, you need a second CXF-BC and CXF-SU for the second service. As for
>>> invoking the second service, you need to add a proxy CXF-BC producer
>>> that can be invoked from the first service to invoke the second service.
>>> Ther should be junit test examples for the CXF component if you do a
>>> source download.
>>> 
>>> Cheers,
>>> 
>>> Ashwin...
>>> 
>>> 
>>> larjohn wrote:
>>>> 
>>>> Thanks, It seems good to me. My problem now is the URI's for the
>>>> endpoints.
>>>> Suppose I have a cxf-bc SU with the following xbean:
>>>> 
>>>> 
>>>> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>>>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
>>>> 
>>>>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>>>>                       targetService="person:PersonService"
>>>>                       targetInterface="person:Person"/>
>>>> 
>>>> </beans>
>>>> 
>>>> 
>>>> Then I also have the example's cxf-se SU, with the xbean:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!--
>>>>     
>>>>     Licensed to the Apache Software Foundation (ASF) under one or more
>>>>     contributor license agreements.  See the NOTICE file distributed
>>>> with
>>>>     this work for additional information regarding copyright ownership.
>>>>     The ASF licenses this file to You under the Apache License, Version
>>>> 2.0
>>>>     (the "License"); you may not use this file except in compliance
>>>> with
>>>>     the License.  You may obtain a copy of the License at
>>>>     
>>>>     http://www.apache.org/licenses/LICENSE-2.0
>>>>     
>>>>     Unless required by applicable law or agreed to in writing, software
>>>>     distributed under the License is distributed on an "AS IS" BASIS,
>>>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>> implied.
>>>>     See the License for the specific language governing permissions and
>>>>     limitations under the License.
>>>> 
>>>> -->
>>>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
>>>> 
>>>>     <cxfse:endpoint>
>>>>         <cxfse:pojo>
>>>>           <bean
>>>> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>>>>         </cxfse:pojo>
>>>>     </cxfse:endpoint>
>>>> 
>>>> </beans>
>>>> 
>>>> 
>>>> As you can see, they are directly taken from the wsdl-cxf example. The
>>>> java and wsdl's are also included as they are in the example. 
>>>> Now, I need to create another cxf-se to warp a pojo (is that a right
>>>> approach?). The first cxf-se should request the second's service, so
>>>> that it can return a specific response. That is where I get stuck! 
>>>>  - Do I need another cxf-bc for the second cxf-se? 
>>>>  - If I use Camel what endpoints should I enter in the from and the to
>>>> strings? 
>>>>  - Will the response return to the first cxf-se and when? Will it
>>>> block?
>>>> 
>>>> 
>>>> Ashwin Karpe wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> I guess what you are looking for is described on the following Camel
>>>>> link
>>>>> 
>>>>>  http://camel.apache.org/pipes-and-filters.html
>>>>> http://camel.apache.org/pipes-and-filters.html 
>>>>> 
>>>>> Check this out. There is no need to write component code. You can use
>>>>> the DSL described in the link
>>>>> 
>>>>> Hope this helps.
>>>>> 
>>>>> Cheers,
>>>>> 
>>>>> Ashwin...
>>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21663367.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by larjohn <la...@gmail.com>.
Actually, they can communicate through the NMR without extra bc's. They can
either use the ServicemixClient, or concerning cxf-se, they can use proxies
to communicate even simplier.


melu wrote:
> 
> Hi,
> 
> Does it mean that all components have to be directly exposed to the world?
> Is it not possible to do such scenario: have one service and SU and BC and
> second service and... only SU and one want to that one service will
> communicate to these second service but second service is not exposed
> through the world and all communication between them is through NMR.
> 
> Thanks
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> Yes, you need a second CXF-BC and CXF-SU for the second service. As for
>> invoking the second service, you need to add a proxy CXF-BC producer that
>> can be invoked from the first service to invoke the second service. Ther
>> should be junit test examples for the CXF component if you do a source
>> download.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> 
>> larjohn wrote:
>>> 
>>> Thanks, It seems good to me. My problem now is the URI's for the
>>> endpoints.
>>> Suppose I have a cxf-bc SU with the following xbean:
>>> 
>>> 
>>> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
>>> 
>>>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>>>                       targetService="person:PersonService"
>>>                       targetInterface="person:Person"/>
>>> 
>>> </beans>
>>> 
>>> 
>>> Then I also have the example's cxf-se SU, with the xbean:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!--
>>>     
>>>     Licensed to the Apache Software Foundation (ASF) under one or more
>>>     contributor license agreements.  See the NOTICE file distributed
>>> with
>>>     this work for additional information regarding copyright ownership.
>>>     The ASF licenses this file to You under the Apache License, Version
>>> 2.0
>>>     (the "License"); you may not use this file except in compliance with
>>>     the License.  You may obtain a copy of the License at
>>>     
>>>     http://www.apache.org/licenses/LICENSE-2.0
>>>     
>>>     Unless required by applicable law or agreed to in writing, software
>>>     distributed under the License is distributed on an "AS IS" BASIS,
>>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>     See the License for the specific language governing permissions and
>>>     limitations under the License.
>>> 
>>> -->
>>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
>>> 
>>>     <cxfse:endpoint>
>>>         <cxfse:pojo>
>>>           <bean
>>> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>>>         </cxfse:pojo>
>>>     </cxfse:endpoint>
>>> 
>>> </beans>
>>> 
>>> 
>>> As you can see, they are directly taken from the wsdl-cxf example. The
>>> java and wsdl's are also included as they are in the example. 
>>> Now, I need to create another cxf-se to warp a pojo (is that a right
>>> approach?). The first cxf-se should request the second's service, so
>>> that it can return a specific response. That is where I get stuck! 
>>>  - Do I need another cxf-bc for the second cxf-se? 
>>>  - If I use Camel what endpoints should I enter in the from and the to
>>> strings? 
>>>  - Will the response return to the first cxf-se and when? Will it block?
>>> 
>>> 
>>> Ashwin Karpe wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I guess what you are looking for is described on the following Camel
>>>> link
>>>> 
>>>>  http://camel.apache.org/pipes-and-filters.html
>>>> http://camel.apache.org/pipes-and-filters.html 
>>>> 
>>>> Check this out. There is no need to write component code. You can use
>>>> the DSL described in the link
>>>> 
>>>> Hope this helps.
>>>> 
>>>> Cheers,
>>>> 
>>>> Ashwin...
>>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21663312.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by melu <ml...@gmail.com>.
Hi,

Does it mean that all components have to be directly exposed to the world?
Is it not possible to do such scenario: have one service and SU and BC and
second service and... only SU and one want to that one service will
communicate to these second service but second service is not exposed
through the world and all communication between them is through NMR.

Thanks



Ashwin Karpe wrote:
> 
> Hi,
> 
> Yes, you need a second CXF-BC and CXF-SU for the second service. As for
> invoking the second service, you need to add a proxy CXF-BC producer that
> can be invoked from the first service to invoke the second service. Ther
> should be junit test examples for the CXF component if you do a source
> download.
> 
> Cheers,
> 
> Ashwin...
> 
> 
> larjohn wrote:
>> 
>> Thanks, It seems good to me. My problem now is the URI's for the
>> endpoints.
>> Suppose I have a cxf-bc SU with the following xbean:
>> 
>> 
>> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
>> 
>>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>>                       targetService="person:PersonService"
>>                       targetInterface="person:Person"/>
>> 
>> </beans>
>> 
>> 
>> Then I also have the example's cxf-se SU, with the xbean:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!--
>>     
>>     Licensed to the Apache Software Foundation (ASF) under one or more
>>     contributor license agreements.  See the NOTICE file distributed with
>>     this work for additional information regarding copyright ownership.
>>     The ASF licenses this file to You under the Apache License, Version
>> 2.0
>>     (the "License"); you may not use this file except in compliance with
>>     the License.  You may obtain a copy of the License at
>>     
>>     http://www.apache.org/licenses/LICENSE-2.0
>>     
>>     Unless required by applicable law or agreed to in writing, software
>>     distributed under the License is distributed on an "AS IS" BASIS,
>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>     See the License for the specific language governing permissions and
>>     limitations under the License.
>> 
>> -->
>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
>> 
>>     <cxfse:endpoint>
>>         <cxfse:pojo>
>>           <bean
>> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>>         </cxfse:pojo>
>>     </cxfse:endpoint>
>> 
>> </beans>
>> 
>> 
>> As you can see, they are directly taken from the wsdl-cxf example. The
>> java and wsdl's are also included as they are in the example. 
>> Now, I need to create another cxf-se to warp a pojo (is that a right
>> approach?). The first cxf-se should request the second's service, so that
>> it can return a specific response. That is where I get stuck! 
>>  - Do I need another cxf-bc for the second cxf-se? 
>>  - If I use Camel what endpoints should I enter in the from and the to
>> strings? 
>>  - Will the response return to the first cxf-se and when? Will it block?
>> 
>> 
>> Ashwin Karpe wrote:
>>> 
>>> Hi,
>>> 
>>> I guess what you are looking for is described on the following Camel
>>> link
>>> 
>>>  http://camel.apache.org/pipes-and-filters.html
>>> http://camel.apache.org/pipes-and-filters.html 
>>> 
>>> Check this out. There is no need to write component code. You can use
>>> the DSL described in the link
>>> 
>>> Hope this helps.
>>> 
>>> Cheers,
>>> 
>>> Ashwin...
>>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21662293.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Yes, you need a second CXF-BC and CXF-SU for the second service. As for
invoking the second service, you need to add a proxy CXF-BC producer that
can be invoked from the first service to invoke the second service. Ther
should be junit test examples for the CXF component if you do a source
download.

Cheers,

Ashwin...


larjohn wrote:
> 
> Thanks, It seems good to me. My problem now is the URI's for the
> endpoints.
> Suppose I have a cxf-bc SU with the following xbean:
> 
> 
> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
> 
>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>                       targetService="person:PersonService"
>                       targetInterface="person:Person"/>
> 
> </beans>
> 
> 
> Then I also have the example's cxf-se SU, with the xbean:
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
>     
>     Licensed to the Apache Software Foundation (ASF) under one or more
>     contributor license agreements.  See the NOTICE file distributed with
>     this work for additional information regarding copyright ownership.
>     The ASF licenses this file to You under the Apache License, Version
> 2.0
>     (the "License"); you may not use this file except in compliance with
>     the License.  You may obtain a copy of the License at
>     
>     http://www.apache.org/licenses/LICENSE-2.0
>     
>     Unless required by applicable law or agreed to in writing, software
>     distributed under the License is distributed on an "AS IS" BASIS,
>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
>     See the License for the specific language governing permissions and
>     limitations under the License.
> 
> -->
> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
> 
>     <cxfse:endpoint>
>         <cxfse:pojo>
>           <bean
> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>         </cxfse:pojo>
>     </cxfse:endpoint>
> 
> </beans>
> 
> 
> As you can see, they are directly taken from the wsdl-cxf example. The
> java and wsdl's are also included as they are in the example. 
> Now, I need to create another cxf-se to warp a pojo (is that a right
> approach?). The first cxf-se should request the second's service, so that
> it can return a specific response. That is where I get stuck! 
>  - Do I need another cxf-bc for the second cxf-se? 
>  - If I use Camel what endpoints should I enter in the from and the to
> strings? 
>  - Will the response return to the first cxf-se and when? Will it block?
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> I guess what you are looking for is described on the following Camel link
>> 
>>  http://camel.apache.org/pipes-and-filters.html
>> http://camel.apache.org/pipes-and-filters.html 
>> 
>> Check this out. There is no need to write component code. You can use the
>> DSL described in the link
>> 
>> Hope this helps.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21577801.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by larjohn <la...@gmail.com>.
Thanks, It seems good to me. My problem now is the URI's for the endpoints.
Suppose I have a cxf-bc SU with the following xbean:


<beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
       xmlns:person="http://servicemix.apache.org/samples/wsdl-first">

  <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
                      targetService="person:PersonService"
                      targetInterface="person:Person"/>

</beans>


Then I also have the example's cxf-se SU, with the xbean:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">

    <cxfse:endpoint>
        <cxfse:pojo>
          <bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl"
/>
        </cxfse:pojo>
    </cxfse:endpoint>

</beans>


As you can see, they are directly taken from the wsdl-cxf example. The java
and wsdl's are also included as they are in the example. 
Now, I need to create another cxf-se to warp a pojo (is that a right
approach?). The first cxf-se should request the second's service, so that it
can return a specific response. That is where I get stuck! 
 - Do I need another cxf-bc for the second cxf-se? 
 - If I use Camel what endpoints should I enter in the from and the to
strings? 
 - Will the response return to the first cxf-se and when? Will it block?


Ashwin Karpe wrote:
> 
> Hi,
> 
> I guess what you are looking for is described on the following Camel link
> 
>  http://camel.apache.org/pipes-and-filters.html
> http://camel.apache.org/pipes-and-filters.html 
> 
> Check this out. There is no need to write component code. You can use the
> DSL described in the link
> 
> Hope this helps.
> 
> Cheers,
> 
> Ashwin...
> 
-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21574407.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

I guess what you are looking for is described on the following Camel link

http://camel.apache.org/pipes-and-filters.html
http://camel.apache.org/pipes-and-filters.html 

Check this out. There is no need to write component code. You can use the
DSL described in the link

Hope this helps.

Cheers,

Ashwin...


larjohn wrote:
> 
> Thanks, but I doubt I can do that myself for the time being. So I need to
> use Camel to exchange messages between two service units? Let's say I have
> a service unit that has to ask information from an other one, then
> manipulate it some way and send some related information to a third
> service unit. Do they need a routing component to talk?
> Can't they talk directly? I mean if I can code it in their java files. I
> saw something about a context and a delivery channel in every component
> documentation but I don't know how to use it. 
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> If you want to use the NMR directly with CXF and Camel, there is an
>> example of this in the Servicemix 4.x OSGI based download.
>> 
>> If you intend to use this with Servicemix 3.x then you will need to port
>> the POMs to not generate bundles.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> 
>> larjohn wrote:
>>> 
>>> Hi, I am still a beginner in Servicemix so please be patient while
>>> answering questions like mine :-P
>>> 
>>> I have two service units on top of cxf-se in the same service
>>> assemblies. They are both copies of the wsdl-cxf example, but with
>>> different endpoints. I see how the outter world sends messages to the
>>> cxf-se through cxf-bc or an http, but I wonder which is the simpler way
>>> to send a message (eg a string) from the one cxf-se to the other through
>>> the nmr. I mean what do I need to implement in their classes? Is there a
>>> specific interface? Will they be notified automatically for incoming
>>> messages? I have seen samples with camel, eip and routing, but I think
>>> it can be done without them, can't it? I don't need a complex solution,
>>> just a simple one, to say hello world from the one cxf-se to the other,
>>> and a simple way to test that, without unittests (where do
>>> system.out.writes go?).
>>> Can you help me?
>>> 
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21574249.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by larjohn <la...@gmail.com>.
Thanks, but I doubt I can do that myself for the time being. So I need to use
Camel to exchange messages between two service units? Let's say I have a
service unit that has to ask information from an other one, then manipulate
it some way and send some related information to a third service unit. Do
they need a routing component to talk?
Can't they talk directly? I mean if I can code it in their java files. I saw
something about a context and a delivery channel in every component
documentation but I don't know how to use it. 



Ashwin Karpe wrote:
> 
> Hi,
> 
> If you want to use the NMR directly with CXF and Camel, there is an
> example of this in the Servicemix 4.x OSGI based download.
> 
> If you intend to use this with Servicemix 3.x then you will need to port
> the POMs to not generate bundles.
> 
> Cheers,
> 
> Ashwin...
> 
> 
> larjohn wrote:
>> 
>> Hi, I am still a beginner in Servicemix so please be patient while
>> answering questions like mine :-P
>> 
>> I have two service units on top of cxf-se in the same service assemblies.
>> They are both copies of the wsdl-cxf example, but with different
>> endpoints. I see how the outter world sends messages to the cxf-se
>> through cxf-bc or an http, but I wonder which is the simpler way to send
>> a message (eg a string) from the one cxf-se to the other through the nmr.
>> I mean what do I need to implement in their classes? Is there a specific
>> interface? Will they be notified automatically for incoming messages? I
>> have seen samples with camel, eip and routing, but I think it can be done
>> without them, can't it? I don't need a complex solution, just a simple
>> one, to say hello world from the one cxf-se to the other, and a simple
>> way to test that, without unittests (where do system.out.writes go?).
>> Can you help me?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21563359.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Component to component messaging in a simple way

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

If you want to use the NMR directly with CXF and Camel, there is an example
of this in the Servicemix 4.x OSGI based download.

If you intend to use this with Servicemix 3.x then you will need to port the
POMs to not generate bundles.

Cheers,

Ashwin...


larjohn wrote:
> 
> Hi, I am still a beginner in Servicemix so please be patient while
> answering questions like mine :-P
> 
> I have two service units on top of cxf-se in the same service assemblies.
> They are both copies of the wsdl-cxf example, but with different
> endpoints. I see how the outter world sends messages to the cxf-se through
> cxf-bc or an http, but I wonder which is the simpler way to send a message
> (eg a string) from the one cxf-se to the other through the nmr. I mean
> what do I need to implement in their classes? Is there a specific
> interface? Will they be notified automatically for incoming messages? I
> have seen samples with camel, eip and routing, but I think it can be done
> without them, can't it? I don't need a complex solution, just a simple
> one, to say hello world from the one cxf-se to the other, and a simple way
> to test that, without unittests (where do system.out.writes go?).
> Can you help me?
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21562197.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.