Tabnine Logo
org.apache.activemq
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.activemq

Best Java code snippets using org.apache.activemq (Showing top 20 results out of 1,467)

origin: apache/activemq

ActiveMQSessionExecutor(ActiveMQSession session) {
  this.session = session;
  if (this.session.connection != null && this.session.connection.isMessagePrioritySupported()) {
    this.messageQueue = new SimplePriorityMessageDispatchChannel();
  }else {
    this.messageQueue = new FifoMessageDispatchChannel();
  }
}
origin: apache/activemq

synchronized void start() {
  if (!messageQueue.isRunning()) {
    messageQueue.start();
    if (hasUncomsumedMessages()) {
      wakeup();
    }
  }
}
origin: apache/activemq

/**
 * @return Returns the QueueConnection.
 */
@Override
public QueueConnection createQueueConnection(String userName, String password) throws JMSException {
  return createActiveMQConnection(userName, password).enforceQueueOnlyConnection();
}
origin: apache/activemq

private void immediateIndividualTransactedAck(MessageDispatch md) throws JMSException {
  // acks accumulate on the broker pending transaction completion to indicate
  // delivery status
  registerSync();
  MessageAck ack = new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1);
  ack.setTransactionId(session.getTransactionContext().getTransactionId());
  session.sendAck(ack);
}
origin: apache/activemq

public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
  checkClosedOrFailed();
  ensureConnectionInfoSent();
  return new ActiveMQXASession(this, getNextSessionId(), getAckMode(), isDispatchAsync());
}
origin: apache/activemq

protected void sendAck(MessageAck ack, boolean lazy) throws JMSException {
  if (lazy || connection.isSendAcksAsync() || getTransacted()) {
    asyncSendPacket(ack);
  } else {
    syncSendPacket(ack);
  }
}
origin: apache/activemq

/**
 * Send TransactionInfo to indicate transaction has started
 *
 * @throws JMSException if some internal error occurs
 */
protected void doStartTransaction() throws JMSException {
  if (getTransacted() && !transactionContext.isInXATransaction()) {
    transactionContext.begin();
  }
}
origin: apache/activemq

protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception {
  ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats);
  configureXAConnection(connection);
  return connection;
}
origin: apache/activemq

@Override
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception {
  ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats);
  configureXAConnection(connection);
  return connection;
}
origin: apache/activemq

  @Override
  public void execute() throws Exception {
    checkClosed();
    session.checkClosed();
    acknowledge(md);
  }
});
origin: apache/activemq

/**
 * send a Packet through the Connection - for internal use only
 *
 * @param command
 * @throws JMSException
 */
public void asyncSendPacket(Command command) throws JMSException {
  if (isClosed()) {
    throw new ConnectionClosedException();
  } else {
    doAsyncSendPacket(command);
  }
}
origin: apache/activemq

  @Override
  public void run() {
    try {
      if (!unconsumedMessages.isClosed()) {
        for(MessageDispatch dispatch : pendingRedeliveries) {
          session.dispatch(dispatch);
        }
      }
    } catch (Exception e) {
      session.connection.onAsyncException(e);
    }
  }
}, redeliveryDelay);
origin: apache/activemq

  @Override
  public void execute() throws Exception {
    checkClosed();
    session.checkClosed();
    session.acknowledge();
  }
});
origin: apache/activemq

/**
 * Sets the prefeftch policy to one.
 */
protected void setPrefetchToOne() {
  ActiveMQPrefetchPolicy prefetchPolicy = getPrefetchPolicy();
  prefetchPolicy.setQueuePrefetch(1);
  prefetchPolicy.setTopicPrefetch(1);
  prefetchPolicy.setDurableTopicPrefetch(1);
  prefetchPolicy.setOptimizeDurableTopicPrefetch(1);
}
origin: apache/activemq

protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception {
  ActiveMQConnection connection = new ActiveMQConnection(transport, getClientIdGenerator(),
      getConnectionIdGenerator(), stats);
  return connection;
}
origin: apache/activemq

private ConsumerId redeliveryPendingInCompetingTransaction(MessageDispatch md) {
  for (ActiveMQSession activeMQSession: session.connection.getSessions()) {
    for (ActiveMQMessageConsumer activeMQMessageConsumer : activeMQSession.consumers) {
      if (activeMQMessageConsumer.redeliveryExpectedInCurrentTransaction(md, false)) {
        return activeMQMessageConsumer.getConsumerId();
      }
    }
  }
  return null;
}
origin: apache/activemq

/**
 * Gets the <CODE>Topic</CODE> associated with this subscriber.
 *
 * @return this subscriber's <CODE>Topic</CODE>
 * @throws JMSException if the JMS provider fails to get the topic for this topic
 *                      subscriber due to some internal error.
 */
public Topic getTopic() throws JMSException {
  checkClosed();
  return (Topic) super.getDestination();
}
origin: apache/activemq

  /**
   * Gets the <CODE>Queue</CODE> associated with this queue receiver.
   *
   * @return this receiver's <CODE>Queue</CODE>
   * @throws JMSException if the JMS provider fails to get the queue for this
   *                 queue receiver due to some internal error.
   */
  @Override
  public Queue getQueue() throws JMSException {
    checkClosed();
    return (Queue)super.getDestination();
  }
}
origin: apache/activemq

void executeFirst(MessageDispatch message) {
  messageQueue.enqueueFirst(message);
  wakeup();
}
origin: apache/activemq

/**
 * @return Returns the QueueConnection.
 * @throws JMSException
 */
@Override
public QueueConnection createQueueConnection() throws JMSException {
  return createActiveMQConnection().enforceQueueOnlyConnection();
}
org.apache.activemq

Most used classes

  • ActiveMQConnectionFactory
    ActiveMQ Artemis implementation of a JMS ConnectionFactory. This connection factory will use defaul
  • BrokerService
    Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a number of transport conn
  • ActiveMQQueue
  • ActiveMQTopic
  • SimpleString
  • ActiveMQDestination,
  • ActiveMQMessage,
  • Message,
  • ActiveMQBuffer,
  • ServerLocator,
  • ConnectionInfo,
  • ActiveMQConnection,
  • ActiveMQTextMessage,
  • ActiveMQException,
  • Pair,
  • TransportConnector,
  • ClientSessionFactory,
  • ActiveMQConnectionFactory,
  • ConsumerInfo
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now