Class AbstractRabbitMQProducer
- java.lang.Object
-
- io.gridgo.framework.AbstractComponentLifecycle
-
- io.gridgo.connector.impl.AbstractProducer
-
- io.gridgo.connector.rabbitmq.impl.AbstractRabbitMQProducer
-
- All Implemented Interfaces:
io.gridgo.connector.Producer,RabbitMQChannelLifeCycle,RabbitMQProducer,io.gridgo.connector.support.ProducerCapability,io.gridgo.framework.ComponentLifecycle,io.gridgo.utils.helper.Loggable,io.gridgo.utils.helper.Startable
- Direct Known Subclasses:
DefaultRabbitMQProducer
public abstract class AbstractRabbitMQProducer extends io.gridgo.connector.impl.AbstractProducer implements RabbitMQProducer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRabbitMQProducer(io.gridgo.connector.support.config.ConnectorContext context, com.rabbitmq.client.Connection connection, RabbitMQQueueConfig queueConfig, java.lang.String uniqueIdentifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]buildRequestBody(io.gridgo.framework.support.Payload payload)org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception>call(io.gridgo.framework.support.Message request)protected com.rabbitmq.client.AMQP.BasicPropertiescreateBasicProperties(java.lang.String correlationId)protected org.joo.promise4j.Deferred<io.gridgo.framework.support.Message,java.lang.Exception>createDeferred()protected java.lang.StringgenerateName()com.rabbitmq.client.ChannelgetChannel()RabbitMQQueueConfiggetQueueConfig()java.lang.StringgetResponseQueue()protected java.lang.StringgetUniqueIdentifier()booleanisCallSupported()protected voidonStart()protected voidonStop()voidsend(io.gridgo.framework.support.Message request)org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception>sendWithAck(io.gridgo.framework.support.Message message)-
Methods inherited from class io.gridgo.connector.impl.AbstractProducer
ack, ack, ack, ack, createMessage, getContext
-
Methods inherited from class io.gridgo.framework.AbstractComponentLifecycle
getName, isStarted, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.gridgo.connector.support.ProducerCapability
isSendSupported, isSendWithAckSupported
-
Methods inherited from interface io.gridgo.connector.rabbitmq.RabbitMQChannelLifeCycle
closeChannel, initChannel
-
Methods inherited from interface io.gridgo.connector.rabbitmq.RabbitMQProducer
initResponseQueue, publish
-
-
-
-
Constructor Detail
-
AbstractRabbitMQProducer
protected AbstractRabbitMQProducer(@NonNull io.gridgo.connector.support.config.ConnectorContext context, @NonNull com.rabbitmq.client.Connection connection, @NonNull RabbitMQQueueConfig queueConfig, @NonNull java.lang.String uniqueIdentifier)
-
-
Method Detail
-
buildRequestBody
protected byte[] buildRequestBody(io.gridgo.framework.support.Payload payload)
-
call
public final org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception> call(io.gridgo.framework.support.Message request)
- Specified by:
callin interfaceio.gridgo.connector.Producer
-
createBasicProperties
protected com.rabbitmq.client.AMQP.BasicProperties createBasicProperties(java.lang.String correlationId)
-
createDeferred
protected org.joo.promise4j.Deferred<io.gridgo.framework.support.Message,java.lang.Exception> createDeferred()
-
generateName
protected java.lang.String generateName()
- Specified by:
generateNamein classio.gridgo.framework.AbstractComponentLifecycle
-
isCallSupported
public boolean isCallSupported()
- Specified by:
isCallSupportedin interfaceio.gridgo.connector.support.ProducerCapability
-
onStart
protected void onStart()
- Specified by:
onStartin classio.gridgo.framework.AbstractComponentLifecycle
-
onStop
protected void onStop()
- Specified by:
onStopin classio.gridgo.framework.AbstractComponentLifecycle
-
send
public final void send(@NonNull io.gridgo.framework.support.Message request)- Specified by:
sendin interfaceio.gridgo.connector.Producer
-
sendWithAck
public final org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception> sendWithAck(@NonNull io.gridgo.framework.support.Message message)- Specified by:
sendWithAckin interfaceio.gridgo.connector.Producer
-
getQueueConfig
public RabbitMQQueueConfig getQueueConfig()
- Specified by:
getQueueConfigin interfaceRabbitMQChannelLifeCycle
-
getChannel
public com.rabbitmq.client.Channel getChannel()
- Specified by:
getChannelin interfaceRabbitMQChannelLifeCycle
-
getResponseQueue
public java.lang.String getResponseQueue()
-
getUniqueIdentifier
protected java.lang.String getUniqueIdentifier()
-
-