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()
ClientProducer
null
if the ClientProducer
was creating without specifying an address, that is by using ClientSession.createProducer()
.getAddress
in interface ClientProducer
public void send(Message msg) throws HornetQException
ClientProducer
ClientSession.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 ClientProducer
msg
- the message to sendHornetQException
- if an exception occurs while sending the messagepublic void send(SimpleString address, Message msg) throws HornetQException
ClientProducer
ClientSessionFactory#setBlockOnDurableSend(boolean)
or org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)
are set to true for the specified message type.send
in interface ClientProducer
address
- 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
ClientProducer
ClientSessionFactory#setBlockOnDurableSend(boolean)
or org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)
are set to true for the specified message type.send
in interface ClientProducer
address
- the address where the message will be sentmessage
- the message to sendHornetQException
- if an exception occurs while sending the messagepublic void close() throws HornetQException
ClientProducer
close
in interface ClientProducer
HornetQException
- if an exception occurs while closing the producerpublic void cleanUp()
cleanUp
in interface ClientProducerInternal
public boolean isClosed()
ClientProducer
isClosed
in interface ClientProducer
true
if the producer is closed, false
elsepublic boolean isBlockOnDurableSend()
ClientProducer
isBlockOnDurableSend
in interface ClientProducer
true
if the producer blocks when sending durable, false
elsepublic boolean isBlockOnNonDurableSend()
ClientProducer
isBlockOnNonDurableSend
in interface ClientProducer
true
if the producer blocks when sending non-durable, false
elsepublic int getMaxRate()
ClientProducer
getMaxRate
in interface ClientProducer
public ClientProducerCredits getProducerCredits()
getProducerCredits
in interface ClientProducerInternal
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.