模块 org.redkale
程序包 org.redkale.mq

接口 MessageProducer

  • 所有已知实现类:
    MessageAgent.MessageProducerWrapper

    public interface MessageProducer
    MQ消息发送器 ResourceProducer
     public class TestMessageService extends AbstractService {
    
         @ResourceProducer(mq = "mymq")
          private MessageProducer producer;
    
          @Override
          public void init(AnyValue config) {
               sendMessage();
          }
    
          public void sendMessage() {
               TestBean bean = new TestBean(12345, "this is a message");
               System.out.println("生产消息: " + bean);
               producer.sendMessage("test_bean_topic", bean);
          }
     }
     

    详情见: https://redkale.org

    从以下版本开始:
    2.8.0
    作者:
    zhangjx
    另请参阅:
    ResourceProducer