Class RabbitMqAmqpTransportConnector
java.lang.Object
de.iip_ecosphere.platform.transport.connectors.impl.AbstractTransportConnector
de.iip_ecosphere.platform.transport.connectors.rabbitmq.RabbitMqAmqpTransportConnector
- All Implemented Interfaces:
de.iip_ecosphere.platform.transport.connectors.TransportConnector
public class RabbitMqAmqpTransportConnector
extends de.iip_ecosphere.platform.transport.connectors.impl.AbstractTransportConnector
Implements an AMQP transport connector based on RabbitMQ.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields Modifier and Type Field Description private com.rabbitmq.client.Channelchannelprivate com.rabbitmq.client.Connectionconnectionstatic StringNAME -
Constructor Summary
Constructors Constructor Description RabbitMqAmqpTransportConnector() -
Method Summary
Modifier and Type Method Description voidasyncSend(String stream, Object data)StringcomposeStreamName(String parent, String name)protected voidconfigureFactory(com.rabbitmq.client.ConnectionFactory factory)Allows further factory configuration.voidconnect(de.iip_ecosphere.platform.transport.connectors.TransportParameter params)voiddisconnect()StringgetName()private voidsend(String stream, Object data, boolean block)Sends data tostream.voidsetReceptionCallback(String stream, de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<?> callback)voidsyncSend(String stream, Object data)
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
connection
private com.rabbitmq.client.Connection connection -
channel
private com.rabbitmq.client.Channel channel
-
-
Constructor Details
-
RabbitMqAmqpTransportConnector
public RabbitMqAmqpTransportConnector()
-
-
Method Details
-
syncSend
- Throws:
IOException
-
asyncSend
- Throws:
IOException
-
send
Sends data tostream.- Parameters:
stream- the stream to send todata- the data to send tostreamblock- shall this be a blocking call (ignored)- Throws:
IOException- in cases that sending fails
-
setReceptionCallback
public void setReceptionCallback(String stream, de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<?> callback) throws IOException- Specified by:
setReceptionCallbackin interfacede.iip_ecosphere.platform.transport.connectors.TransportConnector- Overrides:
setReceptionCallbackin classde.iip_ecosphere.platform.transport.connectors.impl.AbstractTransportConnector- Throws:
IOException
-
composeStreamName
-
connect
public void connect(de.iip_ecosphere.platform.transport.connectors.TransportParameter params) throws IOException- Specified by:
connectin interfacede.iip_ecosphere.platform.transport.connectors.TransportConnector- Overrides:
connectin classde.iip_ecosphere.platform.transport.connectors.impl.AbstractTransportConnector- Throws:
IOException
-
configureFactory
protected void configureFactory(com.rabbitmq.client.ConnectionFactory factory)Allows further factory configuration.- Parameters:
factory- the factory to configured
-
disconnect
- Throws:
IOException
-
getName
-