public class ClientProducerImpl extends Object implements ClientProducerInternal
| Constructor and Description |
|---|
ClientProducerImpl(ClientSessionInternal session,
SimpleString address,
TokenBucketLimiter rateLimiter,
boolean blockOnNonDurableSend,
boolean blockOnDurableSend,
boolean autoGroup,
SimpleString groupID,
int minLargeMessageSize,
SessionContext sessionContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp() |
void |
close()
Closes the ClientProducer.
|
SimpleString |
getAddress()
Returns the address where messages will be sent.
|
int |
getMaxRate()
Returns the maximum rate at which a ClientProducer can send messages per second.
|
ClientProducerCredits |
getProducerCredits() |
boolean |
isBlockOnDurableSend()
Returns whether the producer will block when sending durable messages.
|
boolean |
isBlockOnNonDurableSend()
Returns whether the producer will block when sending non-durable messages.
|
boolean |
isClosed()
Returns whether the producer is closed or not.
|
void |
send(Message msg)
Sends a message to an address.
|
void |
send(Message message,
SendAcknowledgementHandler handler)
Sends a message to the specified address instead of the ClientProducer's address.
|
void |
send(SimpleString address1,
Message msg)
Sends a message to the specified address instead of the ClientProducer's address.
|
void |
send(SimpleString address1,
Message message,
SendAcknowledgementHandler handler)
Sends a message to the specified address instead of the ClientProducer's address.
|
void |
send(String address1,
Message message)
Sends a message to the specified address instead of the ClientProducer's address.
|
public ClientProducerImpl(ClientSessionInternal session, SimpleString address, TokenBucketLimiter rateLimiter, boolean blockOnNonDurableSend, boolean blockOnDurableSend, boolean autoGroup, SimpleString groupID, int minLargeMessageSize, SessionContext sessionContext)
public SimpleString getAddress()
ClientProducernull if the ClientProducer
was creating without specifying an address, that is by using ClientSession.createProducer().getAddress in interface ClientProducerpublic void send(Message msg) throws ActiveMQException
ClientProducerClientSession.createProducer(String) or
similar methods. ServerLocator.setBlockOnDurableSend(boolean) or
ServerLocator.setBlockOnNonDurableSend(boolean) are set to true for the
specified message type.send in interface ClientProducermsg - the message to sendActiveMQException - if an exception occurs while sending the messagepublic void send(SimpleString address1, Message msg) throws ActiveMQException
ClientProducerServerLocator.setBlockOnDurableSend(boolean) or
ServerLocator.setBlockOnNonDurableSend(boolean) are set to true for the specified
message type.send in interface ClientProduceraddress1 - the address where the message will be sentmsg - the message to sendActiveMQException - if an exception occurs while sending the messagepublic void send(String address1, Message message) throws ActiveMQException
ClientProducerServerLocator.setBlockOnDurableSend(boolean) or
ServerLocator.setBlockOnNonDurableSend(boolean) are set to true for the specified
message type.send in interface ClientProduceraddress1 - the address where the message will be sentmessage - the message to sendActiveMQException - if an exception occurs while sending the messagepublic void send(SimpleString address1, Message message, SendAcknowledgementHandler handler) throws ActiveMQException
ClientProducer
The handler will only get called if -1.
send in interface ClientProduceraddress1 - the address where the message will be sentmessage - the message to sendhandler - handler to call after receiving a SEND acknowledgement from the serverActiveMQException - if an exception occurs while sending the messagepublic void send(Message message, SendAcknowledgementHandler handler) throws ActiveMQException
ClientProducer
The handler will only get called if -1.
send in interface ClientProducermessage - the message to sendhandler - handler to call after receiving a SEND acknowledgement from the serverActiveMQException - if an exception occurs while sending the messagepublic void close()
throws ActiveMQException
ClientProducerclose in interface AutoCloseableclose in interface ClientProducerActiveMQException - if an exception occurs while closing the producerpublic void cleanUp()
cleanUp in interface ClientProducerInternalpublic boolean isClosed()
ClientProducerisClosed in interface ClientProducertrue if the producer is closed, false elsepublic boolean isBlockOnDurableSend()
ClientProducerisBlockOnDurableSend in interface ClientProducertrue if the producer blocks when sending durable, false elsepublic boolean isBlockOnNonDurableSend()
ClientProducerisBlockOnNonDurableSend in interface ClientProducertrue if the producer blocks when sending non-durable, false elsepublic int getMaxRate()
ClientProducergetMaxRate in interface ClientProducerpublic ClientProducerCredits getProducerCredits()
getProducerCredits in interface ClientProducerInternalCopyright © 2018 JBoss by Red Hat. All rights reserved.