All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zlyx.easy.asyn.supports.activemq.ActiveMQSender Maven / Gradle / Ivy

There is a newer version: 4.3.11
Show newest version
package com.zlyx.easy.asyn.supports.activemq;

import javax.jms.Destination;

import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;

import com.zlyx.easy.asyn.supports.AsynMsgSender;

/**
 * @Auth 赵光
 * @Describle
 * @2019年9月7日
 */
public class ActiveMQSender implements AsynMsgSender {

	@Autowired
	private JmsTemplate jmsTemplate;

	@Override
	public void doQuque(String channel, String message) {
		Destination destination = new ActiveMQQueue(channel);
		jmsTemplate.convertAndSend(destination, message);
	}

	@Override
	public void doTopic(String channel, String message) {
		Destination destination = new ActiveMQTopic(channel);
		jmsTemplate.convertAndSend(destination, message);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy