You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by allisonsdad <bm...@myactv.net> on 2010/05/24 21:56:50 UTC
SMX4 and Clustering: How about a good, comprehensive example?
Folks,
I am trying to implement clustering in SMX 4 and I'm using the cxf-camel-nmr
example to experiment with. From what I have read this example should be a
good fit: it involves the nmr, osgi, and a camel route which could force the
cluster to use another instance of an endpoint.
So my issue is how can I implement clustering in the cxf-camel-nmr example,
or is it NOT possible?
After I have setup the etc/activemq.xml for clustering, I tried to configure
an OsgiSimpleClusterRegistration bean following the sample clustering XML:
<!-- service def -->
<http:consumer id="myHttpConsumer" service="test:myService"
endpoint="myEndpoint" />
<!-- register the service -->
<bean
class="org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
<property name="endpoint" ref="myHttpConsumer" />
</bean>
Then, to register the jaxws endpoint (from the example):
<jaxws:endpoint id="helloWorld"
implementor="org.apache.servicemix.examples.cxfcamel.HelloWorldImpl"
address="nmr:HelloWorld"/>
... I am simply doing this:
<bean
class="org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
<property name="endpoint" ref="helloWorld" />
</bean>
... which produces the following exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name
'org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration
#0' defined in URL bundleentry://279.fwk30844270/META-INF/spring/beans.xml:
Invocation of init method failed; nested exception is
java.lang.IllegalArgumentException: one field to match on must be set
....
How exactly do I register HelloWorldImpl ??
Thanks,
Bret
--
View this message in context: http://old.nabble.com/SMX4-and-Clustering%3A-How-about-a-good%2C-comprehensive-example--tp28661144p28661144.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: SMX4 and Clustering: How about a good, comprehensive example?
Posted by allisonsdad <bm...@myactv.net>.
Thanks for the additional info, Aditya. Yes, we really need a good cxf
example, though I have to wonder if it actually works.
I'm about 8 weeks into trying to deliver a solution to my customer, who I
managed to convince that SMX 4 could cluster (based on the hype in the
documentation). How many times have I fallen for that. I'm beginning to
doubt that it's possible to deliver something useful in 4.x without burning
a ton of hours, and only then if you're able to overcome some major
dead-ends.
--
View this message in context: http://old.nabble.com/SMX4-and-Clustering%3A-How-about-a-good%2C-comprehensive-example--tp28661144p28680879.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: SMX4 and Clustering: How about a good, comprehensive example?
Posted by Aditya Laddha <ad...@gmail.com>.
Some more queries on this one:
I am getting the same error for Jaxws:endpoint.
But it works for nmr example EchoEndpoint.
But still I wasn't able to talk to endpoint from the client provided in the
example over the network. Keeping the settings as multicast and brokername
as default on all the machines.
Interestingly
"one field to match on must be set" error is thrown from class
'SimpleClusterRegistration'
as it is unable to find endpoint filters like or endpointname or servicename
not sure why though.
If we can get a comprehensive example for clustering would be really
helpful.
Thanks,
Aditya
allisonsdad wrote:
>
> Folks,
>
> I am trying to implement clustering in SMX 4 and I'm using the
> cxf-camel-nmr example to experiment with. From what I have read this
> example should be a good fit: it involves the nmr, osgi, and a camel route
> which could force the cluster to use another instance of an endpoint.
>
> So my issue is how can I implement clustering in the cxf-camel-nmr
> example, or is it NOT possible?
>
> After I have setup the etc/activemq.xml for clustering, I tried to
> configure an OsgiSimpleClusterRegistration bean following the sample
> clustering XML:
>
> <!-- service def -->
> <http:consumer id="myHttpConsumer" service="test:myService"
> endpoint="myEndpoint" />
> <!-- register the service -->
> <bean
> class="org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
> <property name="endpoint" ref="myHttpConsumer" />
> </bean>
>
> Then, to register the jaxws endpoint (from the example):
>
> <jaxws:endpoint id="helloWorld"
> implementor="org.apache.servicemix.examples.cxfcamel.HelloWorldImpl"
> address="nmr:HelloWorld"/>
>
> ... I am simply doing this:
>
> <bean
> class="org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
> <property name="endpoint" ref="helloWorld" />
> </bean>
>
> ... which produces the following exception:
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name
> 'org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration
> #0' defined in URL
> bundleentry://279.fwk30844270/META-INF/spring/beans.xml: Invocation of
> init method failed; nested exception is
> java.lang.IllegalArgumentException: one field to match on must be set
> ....
>
> How exactly do I register HelloWorldImpl ??
>
> Thanks,
> Bret
>
--
View this message in context: http://old.nabble.com/SMX4-and-Clustering%3A-How-about-a-good%2C-comprehensive-example--tp28661144p28679318.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: SMX4 and Clustering: How about a good, comprehensive example?
Posted by allisonsdad <bm...@myactv.net>.
Thanks very much, I will try it.
--
View this message in context: http://old.nabble.com/SMX4-and-Clustering%3A-How-about-a-good%2C-comprehensive-example--tp28661144p28705300.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: SMX4 and Clustering: How about a good, comprehensive example?
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
My comment inline
On 2010-5-25, at 上午3:56, allisonsdad wrote:
>
> Folks,
>
> I am trying to implement clustering in SMX 4 and I'm using the cxf-
> camel-nmr
> example to experiment with. From what I have read this example
> should be a
> good fit: it involves the nmr, osgi, and a camel route which could
> force the
> cluster to use another instance of an endpoint.
>
> So my issue is how can I implement clustering in the cxf-camel-nmr
> example,
> or is it NOT possible?
>
> After I have setup the etc/activemq.xml for clustering, I tried to
> configure
> an OsgiSimpleClusterRegistration bean following the sample
> clustering XML:
>
> <!-- service def -->
> <http:consumer id="myHttpConsumer" service="test:myService"
> endpoint="myEndpoint" />
> <!-- register the service -->
> <bean
> class
> =
> "org
> .apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
> <property name="endpoint" ref="myHttpConsumer" />
> </bean>
>
> Then, to register the jaxws endpoint (from the example):
>
> <jaxws:endpoint id="helloWorld"
> implementor="org.apache.servicemix.examples.cxfcamel.HelloWorldImpl"
> address="nmr:HelloWorld"/>
bean with id="helloWorld" is jaxws endpoint, which use nmr
transport(because the address specify nmr prefix), it will create
NMRDestination underlying which is a NMR Endpoint, but here bean with
id="helloWorld" itself not NMR Endpoint, it's jaxws endpoint.
>
> ... I am simply doing this:
>
> <bean
> class
> =
> "org
> .apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
> <property name="endpoint" ref="helloWorld" />
> </bean>
>
So here you pass in endpoint property a jaxws endpoint but not NMR
endpoint, which cause the "one field to match on must be set"
exception, as it can't create endpoint filter from the jaxws endpoint
you pass in. (It want a NMR endpoint or NMR endpoint name/serviceName,
etc)
So Your OsgiSimpleClusterRegistration configuration should be
<bean
class
=
"org
.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
<property name="endpoint" ref="helloWorld" />
<property name="name">
<value>HelloWorld</value>
</property>
<property name="serviceName">
<ref bean="serviceName" />
</property>
</bean>
<bean name="serviceName" class="javax.xml.namespace.QName">
<constructor-arg index="0"><value>http://cxfcamel.examples.servicemix.apache.org/
</value></constructor-arg>
<constructor-arg index="1"><value>HelloWorldImplService</
value></constructor-arg>
</bean>
Freeman
> ... which produces the following exception:
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean
> with name
> 'org
> .apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration
> #0' defined in URL bundleentry://279.fwk30844270/META-INF/spring/
> beans.xml:
> Invocation of init method failed; nested exception is
> java.lang.IllegalArgumentException: one field to match on must be set
> ....
>
> How exactly do I register HelloWorldImpl ??
>
> Thanks,
> Bret
> --
> View this message in context: http://old.nabble.com/SMX4-and-Clustering%3A-How-about-a-good%2C-comprehensive-example--tp28661144p28661144.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com