|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.taobao.metamorphosis.client.extension.spring.MetaqTemplate
public class MetaqTemplate
Helper class that simplifies synchronous MetaQ access code.
构造方法摘要 | |
---|---|
MetaqTemplate()
|
方法摘要 | |
---|---|
void |
destroy()
|
String |
getDefaultTopic()
Returns the default topic for producers. |
MessageBodyConverter<?> |
getMessageBodyConverter()
Returns the message body converter.The default is an instance of JavaSerializationMessageBodyConverter. |
MessageSessionFactory |
getMessageSessionFactory()
Returns the associated message session factory. |
MessageProducer |
getOrCreateProducer(String topic)
Returns or create a message producer for topic. |
boolean |
isShareProducer()
returns if share a message producer between topics.It's false by default. |
SendResult |
send(MessageBuilder builder)
Send message built by message builder.Returns the sent result. |
SendResult |
send(MessageBuilder builder,
long timeout,
TimeUnit unit)
Send message built by message builder.Returns the sent result. |
void |
send(MessageBuilder builder,
SendMessageCallback cb)
Send message asynchronously with callback. |
void |
send(MessageBuilder builder,
SendMessageCallback cb,
long timeout,
TimeUnit unit)
Send message asynchronously with callback. |
void |
setDefaultTopic(String defaultTopic)
Set the default topic for producers. |
void |
setMessageBodyConverter(MessageBodyConverter<?> messageBodyConverter)
Set message body converter. |
void |
setMessageSessionFactory(MessageSessionFactory messageSessionFactory)
Set message session factory fot this template. |
void |
setShareProducer(boolean producerPerTopic)
If true, the template will share a message producer between topics.It's false by default. |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public MetaqTemplate()
方法详细信息 |
---|
public boolean isShareProducer()
public void setShareProducer(boolean producerPerTopic)
producerPerTopic
- public String getDefaultTopic()
public MessageBodyConverter<?> getMessageBodyConverter()
public void setMessageBodyConverter(MessageBodyConverter<?> messageBodyConverter)
messageBodyConverter
- public void setDefaultTopic(String defaultTopic)
defaultTopic
- public MessageSessionFactory getMessageSessionFactory()
public void setMessageSessionFactory(MessageSessionFactory messageSessionFactory)
messageSessionFactory
- public MessageProducer getOrCreateProducer(String topic)
topic
-
public SendResult send(MessageBuilder builder, long timeout, TimeUnit unit) throws InterruptedException
builder
-
InterruptedException
public SendResult send(MessageBuilder builder) throws InterruptedException
builder
-
InterruptedException
public void send(MessageBuilder builder, SendMessageCallback cb, long timeout, TimeUnit unit)
builder
- cb
- timeout
- unit
- public void destroy() throws Exception
org.springframework.beans.factory.DisposableBean
中的 destroy
Exception
public void send(MessageBuilder builder, SendMessageCallback cb)
builder
- cb
-
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |