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,
Channel channel) |
| 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(SimpleString address,
Message msg)
Sends a message to the specified address instead of the ClientProducer's address.
|
void |
send(String address,
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, Channel channel)
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 HornetQException
ClientProducerClientSession.createProducer(String) or similar methods.
ClientSessionFactory#setBlockOnDurableSend(boolean) or org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)
are set to true for the specified message type.send in interface ClientProducermsg - the message to sendHornetQException - if an exception occurs while sending the messagepublic void send(SimpleString address, Message msg) throws HornetQException
ClientProducerClientSessionFactory#setBlockOnDurableSend(boolean) or org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)
are set to true for the specified message type.send in interface ClientProduceraddress - the address where the message will be sentmsg - the message to sendHornetQException - if an exception occurs while sending the messagepublic void send(String address, Message message) throws HornetQException
ClientProducerClientSessionFactory#setBlockOnDurableSend(boolean) or org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)
are set to true for the specified message type.send in interface ClientProduceraddress - the address where the message will be sentmessage - the message to sendHornetQException - if an exception occurs while sending the messagepublic void close()
throws HornetQException
ClientProducerclose in interface ClientProducerHornetQException - 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 © 2012 JBoss by Red Hat. All Rights Reserved.