本文整理了Java中javax.jms.QueueSession.createProducer
方法的一些代码示例,展示了QueueSession.createProducer
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueueSession.createProducer
方法的具体详情如下:
包路径:javax.jms.QueueSession
类名称:QueueSession
方法名:createProducer
暂无
代码示例来源:origin: apache/activemq
@Override
public MessageProducer createProducer(Destination destination) throws JMSException {
if (destination instanceof Topic) {
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
}
return next.createProducer(destination);
}
代码示例来源:origin: spring-projects/spring-framework
given(session.createProducer(destination)).willReturn(messageProducer);
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public MessageProducer createProducer(Destination destination) throws JMSException {
if (destination instanceof Topic) {
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
}
return next.createProducer(destination);
}
代码示例来源:origin: org.apache.activemq/activemq-client
@Override
public MessageProducer createProducer(Destination destination) throws JMSException {
if (destination instanceof Topic) {
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
}
return next.createProducer(destination);
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public MessageProducer createProducer(Destination destination) throws JMSException {
if (destination instanceof Topic) {
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
}
return next.createProducer(destination);
}
代码示例来源:origin: pierre/meteo
/**
* @param destination
* @return
* @throws JMSException
*/
public MessageProducer createProducer(Destination destination) throws JMSException {
if (destination instanceof Topic) {
throw new InvalidDestinationException("Topics are not supported by a QueueSession");
}
return next.createProducer(destination);
}
代码示例来源:origin: org.jbpm/jbpm-human-task-jms
public void messageReceived(QueueSession session, Object message, Destination destination, String selector) throws Exception {
String name = "";
if (destination instanceof Queue) {
name = ((Queue) destination).getQueueName();
} else if (destination instanceof Topic) {
name = ((Topic) destination).getTopicName();
}
MessageProducer producer = (MessageProducer) this.producers.get(name);
if (producer == null) {
producer = session.createProducer(destination);
this.producers.put(name, producer);
}
this.handler.messageReceived(new JMSSessionWriter(session, producer, selector), message);
}
}
代码示例来源:origin: org.jbpm/jbpm-human-task-jms
this.taskServerQueue = this.producerSession.createQueue(taskServerQueueName);
this.responseQueue = this.consumerSession.createQueue(responseQueueName);
this.producer = this.producerSession.createProducer(this.taskServerQueue);
this.connection.start();
return true;
代码示例来源:origin: GluuFederation/oxAuth
private void loggingThroughJMS(OAuth2AuditLog oAuth2AuditLog) {
QueueConnection connection = null;
try {
connection = pooledConnectionFactory.createQueueConnection();
connection.start();
QueueSession session = connection.createQueueSession(transacted, ACK_MODE);
MessageProducer producer = session.createProducer(session.createQueue(CLIENT_QUEUE_NAME));
TextMessage txtMessage = session.createTextMessage();
txtMessage.setText(ServerUtil.asPrettyJson(oAuth2AuditLog));
producer.send(txtMessage);
} catch (JMSException e) {
log.error("Can't send message", e);
} catch (IOException e) {
log.error("Can't serialize the audit log", e);
} catch (Exception e) {
log.error("Can't send message, please check your activeMQ configuration.", e);
} finally {
if (connection == null)
return;
try {
connection.close();
} catch (JMSException e) {
log.error("Can't close connection.");
}
}
}
代码示例来源:origin: apache/activemq-artemis
MessageProducer producer = sess.createProducer(queue);
producer.send(sess.createTextMessage("TEST"));
内容来源于网络,如有侵权,请联系作者删除!