Package org.activemq.message

Examples of org.activemq.message.Receipt


   * @param timeout
   * @throws JMSException
   */
  public void syncSendPacket(Packet packet, int timeout) throws JMSException {
    if (isTransportOK && !closed) {
      Receipt receipt;
      packet.setId(packetIdGenerator.getNextShortSequence());
      packet.setReceiptRequired(true);
      receipt = this.transportChannel.send(packet, timeout);
      if (receipt != null) {
        if (receipt.isFailed()) {
          Throwable e = receipt.getException();
          if (e != null) {
            throw JMSExceptionHelper.newJMSException(e);
          }
          throw new JMSException(
              "syncSendPacket failed with unknown exception");
View Full Code Here


  }

  public Receipt syncSendRequest(Packet packet) throws JMSException {
    checkClosed();
    if (isTransportOK && !closed) {
      Receipt receipt;
      packet.setReceiptRequired(true);
      packet.setId(this.packetIdGenerator.getNextShortSequence());

      receipt = this.transportChannel.send(packet);
      if (receipt != null && receipt.isFailed()) {
        Throwable e = receipt.getException();
        if (e != null) {
          throw (JMSException) new JMSException(e.getMessage())
              .initCause(e);
        }
        throw new JMSException(
View Full Code Here

    // prematurely by using a long timeout here. If the existing client
    // is working heavily and/or over a slow link, it might take some time
    // for it to respond. In such a case, the new client is misconfigured
    // and can wait for a while before being kicked out.

    Receipt r = getChannel().send(packet, timeout);
    if (r == null) throw new JMSException("Client did not respond in time");

  }
View Full Code Here

        }
    }


    private void sendReceipt(short correlationId, Throwable requestEx, boolean failed) {
        Receipt receipt = new Receipt();
        receipt.setCorrelationId(correlationId);
        receipt.setBrokerName(brokerConnector.getBrokerInfo().getBrokerName());
        receipt.setClusterName(brokerConnector.getBrokerInfo().getClusterName());
        receipt.setException(requestEx);
        receipt.setFailed(failed);
        send(receipt);
    }
View Full Code Here

        flowControlSleepTime = info.getFlowControlTimeout();
        // System.out.println("SET FLOW TIMEOUT = " +
        // flowControlSleepTime + " FOR " + info);
      } else if (packet.getPacketType() == Packet.KEEP_ALIVE
          && packet.isReceiptRequired()) {
        Receipt receipt = new Receipt();
        receipt.setCorrelationId(packet.getId());
        receipt.setReceiptRequired(false);
        try {
          asyncSendPacket(receipt);
        } catch (JMSException jmsEx) {
          handleAsyncException(jmsEx);
        }
View Full Code Here

   * @param timeout
   * @throws JMSException
   */
  public void syncSendPacket(Packet packet, int timeout) throws JMSException {
    if (isTransportOK && !closed) {
      Receipt receipt;
      packet.setId(packetIdGenerator.getNextShortSequence());
      packet.setReceiptRequired(true);
      receipt = this.transportChannel.send(packet, timeout);
      if (receipt != null) {
        if (receipt.isFailed()) {
          Throwable e = receipt.getException();
          if (e != null) {
            throw JMSExceptionHelper.newJMSException(e);
          }
          throw new JMSException(
              "syncSendPacket failed with unknown exception");
View Full Code Here

  }

  public Receipt syncSendRequest(Packet packet) throws JMSException {
    checkClosed();
    if (isTransportOK && !closed) {
      Receipt receipt;
      packet.setReceiptRequired(true);
      packet.setId(this.packetIdGenerator.getNextShortSequence());

      receipt = this.transportChannel.send(packet);
      if (receipt != null && receipt.isFailed()) {
        Throwable e = receipt.getException();
        if (e != null) {
          throw (JMSException) new JMSException(e.getMessage())
              .initCause(e);
        }
        throw new JMSException(
View Full Code Here

    // prematurely by using a long timeout here. If the existing client
    // is working heavily and/or over a slow link, it might take some time
    // for it to respond. In such a case, the new client is misconfigured
    // and can wait for a while before being kicked out.

    Receipt r = getChannel().send(packet, timeout);
    if (r == null) throw new JMSException("Client did not respond in time");

  }
View Full Code Here

        }
    }


    private void sendReceipt(short correlationId, Throwable requestEx, boolean failed) {
        Receipt receipt = new Receipt();
        receipt.setCorrelationId(correlationId);
        receipt.setBrokerName(brokerConnector.getBrokerInfo().getBrokerName());
        receipt.setClusterName(brokerConnector.getBrokerInfo().getClusterName());
        receipt.setException(requestEx);
        receipt.setFailed(failed);
        send(receipt);
    }
View Full Code Here

    // prematurely by using a long timeout here. If the existing client
    // is working heavily and/or over a slow link, it might take some time
    // for it to respond. In such a case, the new client is misconfigured
    // and can wait for a while before being kicked out.

    Receipt r = getChannel().send(packet, timeout);
    if (r == null) throw new JMSException("Client did not respond in time");

  }
View Full Code Here

TOP

Related Classes of org.activemq.message.Receipt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.