public class RocketMQTemplate extends org.springframework.messaging.core.AbstractMessageSendingTemplate<String> implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
| 构造器和说明 |
|---|
RocketMQTemplate() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
<T extends org.springframework.messaging.Message> |
asyncSend(String destination,
Collection<T> messages,
org.apache.rocketmq.client.producer.SendCallback sendCallback)
asyncSend batch messages
|
<T extends org.springframework.messaging.Message> |
asyncSend(String destination,
Collection<T> messages,
org.apache.rocketmq.client.producer.SendCallback sendCallback,
long timeout)
asyncSend batch messages in a given timeout.
|
void |
asyncSend(String destination,
org.springframework.messaging.Message<?> message,
org.apache.rocketmq.client.producer.SendCallback sendCallback)
Send message to broker asynchronously. asynchronous transmission is generally used in response time
sensitive business scenarios.
|
void |
asyncSend(String destination,
org.springframework.messaging.Message<?> message,
org.apache.rocketmq.client.producer.SendCallback sendCallback,
long timeout)
Same to
asyncSend(String, Message, SendCallback) with send timeout specified in addition. |
void |
asyncSend(String destination,
org.springframework.messaging.Message<?> message,
org.apache.rocketmq.client.producer.SendCallback sendCallback,
long timeout,
int delayLevel)
Same to
asyncSend(String, Message, SendCallback) with send timeout and delay level specified in
addition. |
void |
asyncSend(String destination,
Object payload,
org.apache.rocketmq.client.producer.SendCallback sendCallback)
|
void |
asyncSend(String destination,
Object payload,
org.apache.rocketmq.client.producer.SendCallback sendCallback,
long timeout)
Same to
asyncSend(String, Object, SendCallback) with send timeout specified in addition. |
void |
asyncSendOrderly(String destination,
org.springframework.messaging.Message<?> message,
String hashKey,
org.apache.rocketmq.client.producer.SendCallback sendCallback)
Same to
asyncSend(String, Message, SendCallback) with send orderly with hashKey by specified. |
void |
asyncSendOrderly(String destination,
org.springframework.messaging.Message<?> message,
String hashKey,
org.apache.rocketmq.client.producer.SendCallback sendCallback,
long timeout)
Same to
asyncSendOrderly(String, Message, String, SendCallback) with send timeout specified in
addition. |
void |
asyncSendOrderly(String destination,
Object payload,
String hashKey,
org.apache.rocketmq.client.producer.SendCallback sendCallback)
|
void |
asyncSendOrderly(String destination,
Object payload,
String hashKey,
org.apache.rocketmq.client.producer.SendCallback sendCallback,
long timeout)
Same to
asyncSendOrderly(String, Object, String, SendCallback) with send timeout specified in addition. |
void |
destroy() |
protected org.springframework.messaging.Message<?> |
doConvert(Object payload,
Map<String,Object> headers,
org.springframework.messaging.core.MessagePostProcessor postProcessor) |
protected void |
doSend(String destination,
org.springframework.messaging.Message<?> message) |
String |
getCharset() |
org.apache.rocketmq.client.consumer.DefaultLitePullConsumer |
getConsumer() |
org.apache.rocketmq.client.producer.MessageQueueSelector |
getMessageQueueSelector() |
org.apache.rocketmq.client.producer.DefaultMQProducer |
getProducer() |
<T> List<T> |
receive(Class<T> clazz)
receive message in pull mode.
|
<T> List<T> |
receive(Class<T> clazz,
long timeout)
Same to
#receive(Class with receive timeout specified in addition. |
void |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback) |
void |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
long timeout) |
void |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
long timeout,
int delayLevel) |
void |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
String hashKey) |
void |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
String hashKey,
long timeout) |
void |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
String hashKey,
long timeout,
int delayLevel)
Send request message in asynchronous mode.
|
<T> T |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
Type type) |
<T> T |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
Type type,
long timeout) |
<T> T |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
Type type,
long timeout,
int delayLevel) |
<T> T |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
Type type,
String hashKey) |
<T> T |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
Type type,
String hashKey,
long timeout) |
<T> T |
sendAndReceive(String destination,
org.springframework.messaging.Message<?> message,
Type type,
String hashKey,
long timeout,
int delayLevel) |
void |
sendAndReceive(String destination,
Object payload,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback) |
void |
sendAndReceive(String destination,
Object payload,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
long timeout) |
void |
sendAndReceive(String destination,
Object payload,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
long timeout,
int delayLevel) |
void |
sendAndReceive(String destination,
Object payload,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
String hashKey) |
void |
sendAndReceive(String destination,
Object payload,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
String hashKey,
long timeout) |
void |
sendAndReceive(String destination,
Object payload,
RocketMQLocalRequestCallback rocketMQLocalRequestCallback,
String hashKey,
long timeout,
int delayLevel) |
<T> T |
sendAndReceive(String destination,
Object payload,
Type type) |
<T> T |
sendAndReceive(String destination,
Object payload,
Type type,
long timeout) |
<T> T |
sendAndReceive(String destination,
Object payload,
Type type,
long timeout,
int delayLevel) |
<T> T |
sendAndReceive(String destination,
Object payload,
Type type,
String hashKey) |
<T> T |
sendAndReceive(String destination,
Object payload,
Type type,
String hashKey,
long timeout) |
<T> T |
sendAndReceive(String destination,
Object payload,
Type type,
String hashKey,
long timeout,
int delayLevel) |
org.apache.rocketmq.client.producer.TransactionSendResult |
sendMessageInTransaction(String destination,
org.springframework.messaging.Message<?> message,
Object arg)
Send Spring Message in Transaction
|
void |
sendOneWay(String destination,
org.springframework.messaging.Message<?> message)
Similar to UDP, this method won't wait for
acknowledgement from broker before return.
|
void |
sendOneWay(String destination,
Object payload)
Same to
sendOneWay(String, Message) |
void |
sendOneWayOrderly(String destination,
org.springframework.messaging.Message<?> message,
String hashKey)
Same to
sendOneWay(String, Message) with send orderly with hashKey by specified. |
void |
sendOneWayOrderly(String destination,
Object payload,
String hashKey)
|
void |
setAsyncSenderExecutor(ExecutorService asyncSenderExecutor) |
void |
setCharset(String charset) |
void |
setConsumer(org.apache.rocketmq.client.consumer.DefaultLitePullConsumer consumer) |
void |
setMessageQueueSelector(org.apache.rocketmq.client.producer.MessageQueueSelector messageQueueSelector) |
void |
setProducer(org.apache.rocketmq.client.producer.DefaultMQProducer producer) |
<T extends org.springframework.messaging.Message> |
syncSend(String destination,
Collection<T> messages)
syncSend batch messages
|
<T extends org.springframework.messaging.Message> |
syncSend(String destination,
Collection<T> messages,
long timeout)
syncSend batch messages in a given timeout.
|
org.apache.rocketmq.client.producer.SendResult |
syncSend(String destination,
org.springframework.messaging.Message<?> message)
Send message in synchronous mode.
|
org.apache.rocketmq.client.producer.SendResult |
syncSend(String destination,
org.springframework.messaging.Message<?> message,
long timeout)
Same to
syncSend(String, Message) with send timeout specified in addition. |
org.apache.rocketmq.client.producer.SendResult |
syncSend(String destination,
org.springframework.messaging.Message<?> message,
long timeout,
int delayLevel)
Same to
syncSend(String, Message) with send timeout specified in addition. |
org.apache.rocketmq.client.producer.SendResult |
syncSend(String destination,
Object payload)
Same to
syncSend(String, Message). |
org.apache.rocketmq.client.producer.SendResult |
syncSend(String destination,
Object payload,
long timeout)
Same to
syncSend(String, Object) with send timeout specified in addition. |
<T extends org.springframework.messaging.Message> |
syncSendOrderly(String destination,
Collection<T> messages,
String hashKey)
syncSend batch messages orderly.
|
<T extends org.springframework.messaging.Message> |
syncSendOrderly(String destination,
Collection<T> messages,
String hashKey,
long timeout)
Same to
syncSendOrderly(String, Collection, String) with send timeout specified in addition. |
org.apache.rocketmq.client.producer.SendResult |
syncSendOrderly(String destination,
org.springframework.messaging.Message<?> message,
String hashKey)
Same to
syncSend(String, Message) with send orderly with hashKey by specified. |
org.apache.rocketmq.client.producer.SendResult |
syncSendOrderly(String destination,
org.springframework.messaging.Message<?> message,
String hashKey,
long timeout)
Same to
syncSendOrderly(String, Message, String) with send timeout specified in addition. |
org.apache.rocketmq.client.producer.SendResult |
syncSendOrderly(String destination,
Object payload,
String hashKey)
Same to
syncSend(String, Object) with send orderly with hashKey by specified. |
org.apache.rocketmq.client.producer.SendResult |
syncSendOrderly(String destination,
Object payload,
String hashKey,
long timeout)
Same to
syncSendOrderly(String, Object, String) with send timeout specified in addition. |
convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, getDefaultDestination, getMessageConverter, getRequiredDefaultDestination, processHeadersToSend, send, send, setDefaultDestination, setMessageConverterpublic org.apache.rocketmq.client.producer.DefaultMQProducer getProducer()
public void setProducer(org.apache.rocketmq.client.producer.DefaultMQProducer producer)
public org.apache.rocketmq.client.consumer.DefaultLitePullConsumer getConsumer()
public void setConsumer(org.apache.rocketmq.client.consumer.DefaultLitePullConsumer consumer)
public String getCharset()
public void setCharset(String charset)
public org.apache.rocketmq.client.producer.MessageQueueSelector getMessageQueueSelector()
public void setMessageQueueSelector(org.apache.rocketmq.client.producer.MessageQueueSelector messageQueueSelector)
public void setAsyncSenderExecutor(ExecutorService asyncSenderExecutor)
public <T> T sendAndReceive(String destination, org.springframework.messaging.Message<?> message, Type type)
destination - formats: `topicName:tags`message - Message the message to be sent.type - The type of Tpublic <T> T sendAndReceive(String destination, Object payload, Type type)
destination - formats: `topicName:tags`payload - the payload to be sent.type - The type of Tpublic <T> T sendAndReceive(String destination, org.springframework.messaging.Message<?> message, Type type, long timeout)
destination - formats: `topicName:tags`message - Message the message to be sent.type - The type of Ttimeout - send timeout in millispublic <T> T sendAndReceive(String destination, Object payload, Type type, long timeout)
destination - formats: `topicName:tags`payload - the payload to be sent.type - The type of Ttimeout - send timeout in millispublic <T> T sendAndReceive(String destination, org.springframework.messaging.Message<?> message, Type type, long timeout, int delayLevel)
destination - formats: `topicName:tags`message - Message the message to be sent.type - The type of Ttimeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public <T> T sendAndReceive(String destination, Object payload, Type type, long timeout, int delayLevel)
destination - formats: `topicName:tags`payload - the payload to be sent.type - The type of Ttimeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public <T> T sendAndReceive(String destination, org.springframework.messaging.Message<?> message, Type type, String hashKey)
destination - formats: `topicName:tags`message - Message the message to be sent.type - The type of ThashKey - needed when sending message orderlypublic <T> T sendAndReceive(String destination, Object payload, Type type, String hashKey)
destination - formats: `topicName:tags`payload - the payload to be sent.type - The type of ThashKey - needed when sending message orderlypublic <T> T sendAndReceive(String destination, org.springframework.messaging.Message<?> message, Type type, String hashKey, long timeout)
destination - formats: `topicName:tags`message - Message the message to be sent.type - The type of ThashKey - needed when sending message orderlytimeout - send timeout in millispublic <T> T sendAndReceive(String destination, Object payload, Type type, String hashKey, long timeout)
destination - formats: `topicName:tags`payload - the payload to be sent.type - The type of ThashKey - public <T> T sendAndReceive(String destination, org.springframework.messaging.Message<?> message, Type type, String hashKey, long timeout, int delayLevel)
destination - formats: `topicName:tags`message - Message the message to be sent.type - The type that receivehashKey - needed when sending message orderlytimeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public <T> T sendAndReceive(String destination, Object payload, Type type, String hashKey, long timeout, int delayLevel)
destination - formats: `topicName:tags`payload - the payload to be sent.type - The type that receivehashKey - needed when sending message orderlytimeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public void sendAndReceive(String destination, org.springframework.messaging.Message<?> message, RocketMQLocalRequestCallback rocketMQLocalRequestCallback)
destination - formats: `topicName:tags`message - Message the message to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.public void sendAndReceive(String destination, Object payload, RocketMQLocalRequestCallback rocketMQLocalRequestCallback)
destination - formats: `topicName:tags`payload - the payload to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.public void sendAndReceive(String destination, org.springframework.messaging.Message<?> message, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, long timeout)
destination - formats: `topicName:tags`message - Message the message to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.timeout - send timeout in millispublic void sendAndReceive(String destination, Object payload, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, long timeout)
destination - formats: `topicName:tags`payload - the payload to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.timeout - send timeout in millispublic void sendAndReceive(String destination, org.springframework.messaging.Message<?> message, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, long timeout, int delayLevel)
destination - formats: `topicName:tags`message - Message the message to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.timeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public void sendAndReceive(String destination, Object payload, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, String hashKey)
destination - formats: `topicName:tags`payload - the payload to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.hashKey - needed when sending message orderlypublic void sendAndReceive(String destination, org.springframework.messaging.Message<?> message, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, String hashKey, long timeout)
destination - formats: `topicName:tags`message - Message the message to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.hashKey - needed when sending message orderlytimeout - send timeout in millispublic void sendAndReceive(String destination, Object payload, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, String hashKey, long timeout)
destination - formats: `topicName:tags`payload - the payload to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.hashKey - needed when sending message orderlytimeout - send timeout in millispublic void sendAndReceive(String destination, org.springframework.messaging.Message<?> message, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, String hashKey)
destination - formats: `topicName:tags`message - Message the message to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.hashKey - needed when sending message orderlypublic void sendAndReceive(String destination, Object payload, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, long timeout, int delayLevel)
destination - formats: `topicName:tags`payload - the payload to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.timeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public void sendAndReceive(String destination, Object payload, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, String hashKey, long timeout, int delayLevel)
destination - formats: `topicName:tags`payload - the payload to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.hashKey - needed when sending message orderlytimeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public void sendAndReceive(String destination, org.springframework.messaging.Message<?> message, RocketMQLocalRequestCallback rocketMQLocalRequestCallback, String hashKey, long timeout, int delayLevel)
rocketMQLocalRequestCallback will be executed. destination - formats: `topicName:tags`message - Message the message to be sent.rocketMQLocalRequestCallback - callback that will invoked when reply message received.hashKey - needed when sending message orderlytimeout - send timeout in millisdelayLevel - message delay level(0 means no delay)public org.apache.rocketmq.client.producer.SendResult syncSend(String destination, org.springframework.messaging.Message<?> message)
Send message in synchronous mode. This method returns only when the sending procedure totally completes. Reliable synchronous transmission is used in extensive scenes, such as important notification messages, SMS notification, SMS marketing system, etc..
Warn: this method has internal retry-mechanism, that is, internal implementation will retry
DefaultMQProducer.getRetryTimesWhenSendFailed() times before claiming failure. As a result, multiple
messages may potentially delivered to broker(s). It's up to the application developers to resolve potential
duplication issue.
destination - formats: `topicName:tags`message - MessageSendResultpublic org.apache.rocketmq.client.producer.SendResult syncSend(String destination, org.springframework.messaging.Message<?> message, long timeout)
syncSend(String, Message) with send timeout specified in addition.destination - formats: `topicName:tags`message - Messagetimeout - send timeout with millisSendResultpublic <T extends org.springframework.messaging.Message> org.apache.rocketmq.client.producer.SendResult syncSend(String destination, Collection<T> messages)
destination - formats: `topicName:tags`messages - Collection of MessageSendResultpublic <T extends org.springframework.messaging.Message> org.apache.rocketmq.client.producer.SendResult syncSend(String destination, Collection<T> messages, long timeout)
destination - formats: `topicName:tags`messages - Collection of Messagetimeout - send timeout with millisSendResultpublic org.apache.rocketmq.client.producer.SendResult syncSend(String destination, org.springframework.messaging.Message<?> message, long timeout, int delayLevel)
syncSend(String, Message) with send timeout specified in addition.destination - formats: `topicName:tags`message - Messagetimeout - send timeout with millisdelayLevel - level for the delay messageSendResultpublic org.apache.rocketmq.client.producer.SendResult syncSend(String destination, Object payload)
syncSend(String, Message).destination - formats: `topicName:tags`payload - the Object to use as payloadSendResultpublic org.apache.rocketmq.client.producer.SendResult syncSend(String destination, Object payload, long timeout)
syncSend(String, Object) with send timeout specified in addition.destination - formats: `topicName:tags`payload - the Object to use as payloadtimeout - send timeout with millisSendResultpublic org.apache.rocketmq.client.producer.SendResult syncSendOrderly(String destination, org.springframework.messaging.Message<?> message, String hashKey)
syncSend(String, Message) with send orderly with hashKey by specified.destination - formats: `topicName:tags`message - MessagehashKey - use this key to select queue. for example: orderId, productId ...SendResultpublic org.apache.rocketmq.client.producer.SendResult syncSendOrderly(String destination, org.springframework.messaging.Message<?> message, String hashKey, long timeout)
syncSendOrderly(String, Message, String) with send timeout specified in addition.destination - formats: `topicName:tags`message - MessagehashKey - use this key to select queue. for example: orderId, productId ...timeout - send timeout with millisSendResultpublic org.apache.rocketmq.client.producer.SendResult syncSendOrderly(String destination, Object payload, String hashKey)
syncSend(String, Object) with send orderly with hashKey by specified.destination - formats: `topicName:tags`payload - the Object to use as payloadhashKey - use this key to select queue. for example: orderId, productId ...SendResultpublic org.apache.rocketmq.client.producer.SendResult syncSendOrderly(String destination, Object payload, String hashKey, long timeout)
syncSendOrderly(String, Object, String) with send timeout specified in addition.destination - formats: `topicName:tags`payload - the Object to use as payloadhashKey - use this key to select queue. for example: orderId, productId ...timeout - send timeout with millisSendResultpublic <T extends org.springframework.messaging.Message> org.apache.rocketmq.client.producer.SendResult syncSendOrderly(String destination, Collection<T> messages, String hashKey)
destination - formats: `topicName:tags`messages - Collection of MessagehashKey - use this key to select queue. for example: orderId, productId ...SendResultpublic <T extends org.springframework.messaging.Message> org.apache.rocketmq.client.producer.SendResult syncSendOrderly(String destination, Collection<T> messages, String hashKey, long timeout)
syncSendOrderly(String, Collection, String) with send timeout specified in addition.destination - formats: `topicName:tags`messages - Collection of MessagehashKey - use this key to select queue. for example: orderId, productId ...timeout - send timeout with millisSendResultpublic void asyncSend(String destination, org.springframework.messaging.Message<?> message, org.apache.rocketmq.client.producer.SendCallback sendCallback, long timeout, int delayLevel)
asyncSend(String, Message, SendCallback) with send timeout and delay level specified in
addition.destination - formats: `topicName:tags`message - MessagesendCallback - SendCallbacktimeout - send timeout with millisdelayLevel - level for the delay messagepublic void asyncSend(String destination, org.springframework.messaging.Message<?> message, org.apache.rocketmq.client.producer.SendCallback sendCallback, long timeout)
asyncSend(String, Message, SendCallback) with send timeout specified in addition.destination - formats: `topicName:tags`message - MessagesendCallback - SendCallbacktimeout - send timeout with millispublic void asyncSend(String destination, org.springframework.messaging.Message<?> message, org.apache.rocketmq.client.producer.SendCallback sendCallback)
Send message to broker asynchronously. asynchronous transmission is generally used in response time sensitive business scenarios.
This method returns immediately. On sending completion, sendCallback will be executed.
Similar to syncSend(String, Object), internal implementation would potentially retry up to DefaultMQProducer.getRetryTimesWhenSendAsyncFailed() times before claiming sending failure, which may yield
message duplication and application developers are the one to resolve this potential issue.
destination - formats: `topicName:tags`message - MessagesendCallback - SendCallbackpublic void asyncSend(String destination, Object payload, org.apache.rocketmq.client.producer.SendCallback sendCallback, long timeout)
asyncSend(String, Object, SendCallback) with send timeout specified in addition.destination - formats: `topicName:tags`payload - the Object to use as payloadsendCallback - SendCallbacktimeout - send timeout with millispublic void asyncSend(String destination, Object payload, org.apache.rocketmq.client.producer.SendCallback sendCallback)
destination - formats: `topicName:tags`payload - the Object to use as payloadsendCallback - SendCallbackpublic <T extends org.springframework.messaging.Message> void asyncSend(String destination, Collection<T> messages, org.apache.rocketmq.client.producer.SendCallback sendCallback)
destination - formats: `topicName:tags`messages - Collection of MessagesendCallback - SendCallbackpublic <T extends org.springframework.messaging.Message> void asyncSend(String destination, Collection<T> messages, org.apache.rocketmq.client.producer.SendCallback sendCallback, long timeout)
destination - formats: `topicName:tags`messages - Collection of MessagesendCallback - SendCallbacktimeout - send timeout with millispublic void asyncSendOrderly(String destination, org.springframework.messaging.Message<?> message, String hashKey, org.apache.rocketmq.client.producer.SendCallback sendCallback, long timeout)
asyncSendOrderly(String, Message, String, SendCallback) with send timeout specified in
addition.destination - formats: `topicName:tags`message - MessagehashKey - use this key to select queue. for example: orderId, productId ...sendCallback - SendCallbacktimeout - send timeout with millispublic void asyncSendOrderly(String destination, org.springframework.messaging.Message<?> message, String hashKey, org.apache.rocketmq.client.producer.SendCallback sendCallback)
asyncSend(String, Message, SendCallback) with send orderly with hashKey by specified.destination - formats: `topicName:tags`message - MessagehashKey - use this key to select queue. for example: orderId, productId ...sendCallback - SendCallbackpublic void asyncSendOrderly(String destination, Object payload, String hashKey, org.apache.rocketmq.client.producer.SendCallback sendCallback)
destination - formats: `topicName:tags`payload - the Object to use as payloadhashKey - use this key to select queue. for example: orderId, productId ...sendCallback - SendCallbackpublic void asyncSendOrderly(String destination, Object payload, String hashKey, org.apache.rocketmq.client.producer.SendCallback sendCallback, long timeout)
asyncSendOrderly(String, Object, String, SendCallback) with send timeout specified in addition.destination - formats: `topicName:tags`payload - the Object to use as payloadhashKey - use this key to select queue. for example: orderId, productId ...sendCallback - SendCallbacktimeout - send timeout with millispublic void sendOneWay(String destination, org.springframework.messaging.Message<?> message)
One-way transmission is used for cases requiring moderate reliability, such as log collection.
destination - formats: `topicName:tags`message - Messagepublic void sendOneWay(String destination, Object payload)
sendOneWay(String, Message)destination - formats: `topicName:tags`payload - the Object to use as payloadpublic void sendOneWayOrderly(String destination, org.springframework.messaging.Message<?> message, String hashKey)
sendOneWay(String, Message) with send orderly with hashKey by specified.destination - formats: `topicName:tags`message - MessagehashKey - use this key to select queue. for example: orderId, productId ...public void sendOneWayOrderly(String destination, Object payload, String hashKey)
destination - formats: `topicName:tags`payload - the Object to use as payloadpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanExceptionprotected void doSend(String destination, org.springframework.messaging.Message<?> message)
doSend 在类中 org.springframework.messaging.core.AbstractMessageSendingTemplate<String>protected org.springframework.messaging.Message<?> doConvert(Object payload, Map<String,Object> headers, org.springframework.messaging.core.MessagePostProcessor postProcessor)
doConvert 在类中 org.springframework.messaging.core.AbstractMessageSendingTemplate<String>public void destroy()
destroy 在接口中 org.springframework.beans.factory.DisposableBeanpublic org.apache.rocketmq.client.producer.TransactionSendResult sendMessageInTransaction(String destination, org.springframework.messaging.Message<?> message, Object arg) throws org.springframework.messaging.MessagingException
destination - destination formats: `topicName:tags`message - message Messagearg - ext argorg.springframework.messaging.MessagingExceptionpublic <T> List<T> receive(Class<T> clazz)
T - clazz - message object typeCopyright © 2022 Apache Software Foundation. All rights reserved.