Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
langxml
<sm:activationSpec service="test:publisher" endpoint="endpoint">
  <sm:component>
    <bean class="org.apache.servicemix.wsn.spring.PublisherComponent">
      <property name="topic" value="myTopic" />
    </bean>
  </sm:component>
</sm:activationSpec>

When the component is started, it registers itself as a publisher to the WS-Notification broker. To do so, it activates a JBI endpoint named subscription so it can handle demand based publishing. When this component receives an InOnly exchange, let's say <hello>world</hello>, it will wrap it in a request as shown here and send the request as an InOnly exchange to the NotifiationBroker. Note that, as this component activates two JBI endpoints, you need to explicitely target the endpoint specified in the activationSpec when sending a message.

The subscription is created inside a servicemix-wsn2005 component. You must fill the consumer and topic properties, where the consumer is the URI-encoded target JBI endpoint, which will be resolved to the first component activated. You could also use the plain spring syntax:

...