Search code examples
wsdlapache-servicemix

ServiceMix + broadcasting message


New to ServiceMix, I'm not sure if it can do what I need:

  • I've an interface defined by wsdl
  • I have several endpoints that implement that interface defined by the wsdl
  • I've a service that can only send the message to one endpoint.

Can service mix do the following:

  1. Producer sends to an endpoint in servicemix (with the wsdl).
  2. ServiceMix broadcasts to the different endpoints the message.

Thanks for the advice and / or pointers!


Solution

  • The simplest would be to use a Camel Recipient List. This would allow you to have either static or dynamic destinations for your broadcast.

    It sounds as if your application doesn't require termination of the SOAP message (de/serialize the payload to/from an object) at the ServiceMix consumer. Therefore it can be kept very simple by using a Camel Jetty proxy:

    There are further details on the link above on how to configure static (the example above) and dynamic routing.

    If your application changes and does require termination of the SOAP message at the ServiceMix consumer in the future, then change out the Camel Jetty consumer endpoint with a Camel CXF endpoint and set bridgeEndpoint to false.

    As for ServiceMix you will need to enable the Camel Jetty component. To have it enabled by default you need to edit the etc/org.apache.karaf.features.cfg file and add camel-jetty to the featuresBoot property. This is typically the best practice for features required by your application. You can also install the feature at the ServiceMix console with the command "features:install camel-jetty".

    The Recipient List capability is part of the Camel Core API which is installed by default and if not, as a dependency of any other Camel component.

    Best Regards, Scott ES