Example usage for com.liferay.portal.kernel.messaging MessageBus addDestination

List of usage examples for com.liferay.portal.kernel.messaging MessageBus addDestination

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.messaging MessageBus addDestination.

Prototype

@Deprecated
public void addDestination(Destination destination);

Source Link

Usage

From source file:com.liferay.analytics.internal.osgi.AnalyticsServiceActivator.java

License:Open Source License

@Override
public synchronized void start(BundleContext bundleContext) throws Exception {

    _bundleContext = bundleContext;// w w  w .j ava  2 s  .com

    SerialDestination destination = new SerialDestination(DESTINATION_NAME);

    MessageBus messageBus = ServiceTrackerUtil.getService(MessageBus.class, bundleContext);

    messageBus.addDestination(destination);

    messageBus.registerMessageListener(DESTINATION_NAME, this);
}

From source file:se.vgregion.messagebus.MessageBusConsumer.java

License:Open Source License

protected void doStart() throws Exception {
    MessageBusEndpoint endpoint = (MessageBusEndpoint) getEndpoint();
    MessageBus messageBus = endpoint.getMessageBus();

    String destination = endpoint.getDestination();

    messageBus.addDestination(new ParallelDestination(destination));

    messageBus.registerMessageListener(destination, new EndpointMessageListener(endpoint, getProcessor()));
}