javax.jms.Connection.createDurableConnectionConsumer()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中javax.jms.Connection.createDurableConnectionConsumer()方法的一些代码示例,展示了Connection.createDurableConnectionConsumer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connection.createDurableConnectionConsumer()方法的具体详情如下:
包路径:javax.jms.Connection
类名称:Connection
方法名:createDurableConnectionConsumer

Connection.createDurableConnectionConsumer介绍

[英]Creates a connection consumer for this connection (optional operation) on the specific topic using an unshared durable subscription with the specified name.

This is an expert facility not used by ordinary JMS clients.

This method must not be used in a Java EE web or EJB application. Doing so may cause a JMSException to be thrown though this is not guaranteed.
[中]使用具有指定名称的非共享持久订阅为此特定主题上的连接(可选操作)创建连接使用者。
这是一个普通JMS客户机不使用的专家工具。
此方法不得用于JavaEEWeb或EJB应用程序中。这样做可能会导致抛出JMSException,但这并不能保证。

代码示例

代码示例来源:origin: openzipkin/brave

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName,
  String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException {
 ConnectionConsumer cc =
   delegate.createDurableConnectionConsumer(topic, subscriptionName, messageSelector,
     sessionPool, maxMessages);
 return TracingConnectionConsumer.create(cc, jmsTracing);
}

代码示例来源:origin: bitronix/btm

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException {
  return nonXaConnection.createDurableConnectionConsumer(topic, subscriptionName, messageSelector, serverSessionPool, maxMessages);
}

代码示例来源:origin: org.apache.openejb/openejb-core

@Override
public ConnectionConsumer createDurableConnectionConsumer(final Topic topic, final String subscriptionName, final String messageSelector, final ServerSessionPool sessionPool, final int maxMessages) throws JMSException {
  return con.createDurableConnectionConsumer(topic, subscriptionName, messageSelector, sessionPool, maxMessages);
}

代码示例来源:origin: com.bbossgroups.rpc/bboss-rpc

public ConnectionConsumer createDurableConnectionConsumer(Topic arg0, String arg1, String arg2,
    ServerSessionPool arg3, int arg4) throws JMSException
{
  
  return con.createDurableConnectionConsumer(arg0, arg1, arg2, arg3, arg4);
}

代码示例来源:origin: com.github.marcus-nl.btm/btm

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException {
  return nonXaConnection.createDurableConnectionConsumer(topic, subscriptionName, messageSelector, serverSessionPool, maxMessages);
}

代码示例来源:origin: org.codehaus.btm/btm

public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException {
  return nonXaConnection.createDurableConnectionConsumer(topic, subscriptionName, messageSelector, serverSessionPool, maxMessages);
}

代码示例来源:origin: org.mule.btm/mule-btm

public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException {
  return nonXaConnection.createDurableConnectionConsumer(topic, subscriptionName, messageSelector, serverSessionPool, maxMessages);
}

代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary

@Override
  public ConnectionConsumer createDurableConnectionConsumer(
                                Topic topic,
                                String subscriptionName,
                                String messageSelector,
                                ServerSessionPool sessionPool,
                                int maxMessages ) throws JMSException {

    return connection.createDurableConnectionConsumer(topic,
                             subscriptionName,
                             messageSelector,
                             sessionPool,
                             maxMessages);
  }
}

代码示例来源:origin: org.seedstack.seed/seed-jms-support-core

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException {
  return getConnection().createDurableConnectionConsumer(topic, subscriptionName, messageSelector, sessionPool, maxMessages);
}

代码示例来源:origin: org.apache.activemq/activemq-jms-pool

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String selector, String s1, ServerSessionPool serverSessionPool, int i) throws JMSException {
  return getConnection().createDurableConnectionConsumer(topic, selector, s1, serverSessionPool, i);
}

代码示例来源:origin: org.seedstack.addons.jms/jms-core

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException {
  return getConnection().createDurableConnectionConsumer(topic, subscriptionName, messageSelector, sessionPool, maxMessages);
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String selector, String s1, ServerSessionPool serverSessionPool, int i) throws JMSException {
  return getConnection().createDurableConnectionConsumer(topic, selector, s1, serverSessionPool, i);
}

代码示例来源:origin: org.seedstack.addons.jms/jms

@Override
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException {
  return getConnection().createDurableConnectionConsumer(topic, subscriptionName, messageSelector, sessionPool, maxMessages);
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

/**
* Setup the connection consumer
* 
* @throws Exeption for any error
*/
protected void setupConsumer() throws Exception
{
 Connection connection = activation.getConnection();
 JmsActivationSpec spec = activation.getActivationSpec();
 String selector = spec.getMessageSelector();
 int maxMessages = spec.getMaxMessagesInt();
 if (activation.isTopic())
 {
   Topic topic = (Topic) activation.getDestination();
   String subscriptionName = spec.getSubscriptionName();
   if (spec.isDurable())
    consumer = connection.createDurableConnectionConsumer(topic, subscriptionName, selector, this, maxMessages);
   else
    consumer = connection.createConnectionConsumer(topic, selector, this, maxMessages);
 }
 else
 {
   Queue queue = (Queue) activation.getDestination();
   consumer = connection.createConnectionConsumer(queue, selector, this, maxMessages);
 }
 log.debug("Created consumer " + consumer);
}

代码示例来源:origin: org.jboss.genericjms/generic-jms-ra-jar

/**
 * Setup the connection consumer
 *
 * @throws Exception for any error
 */
protected void setupConsumer() throws Exception {
  Connection connection = activation.getConnection();
  JmsActivationSpec spec = activation.getActivationSpec();
  String selector = spec.getMessageSelector();
  int maxMessages = spec.getMaxMessagesInt();
  if (activation.isTopic()) {
    Topic topic = (Topic) activation.getDestination();
    String subscriptionName = spec.getSubscriptionName();
    if (spec.isDurable()) {
      consumer = connection.createDurableConnectionConsumer(topic, subscriptionName, selector, this, maxMessages);
    } else {
      consumer = connection.createConnectionConsumer(topic, selector, this, maxMessages);
    }
  } else {
    Queue queue = (Queue) activation.getDestination();
    consumer = connection.createConnectionConsumer(queue, selector, this, maxMessages);
  }
  log.debug("Created consumer " + consumer);
  if (consumer == null) {
    throw new JMSException("Consumer is null");
  }
}

相关文章