Examples of Receipt


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

Examples of org.activemq.message.Receipt

  }

  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

Examples of org.activemq.message.Receipt

    // 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

Examples of org.activemq.message.Receipt

        }
    }


    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

Examples of org.codehaus.activemq.message.Receipt

     * @param timeout
     * @throws JMSException
     */
    public void syncSendPacket(Packet packet, int timeout) throws JMSException {
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            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

Examples of org.codehaus.activemq.message.Receipt

    }

    public Receipt syncSendRequest(Packet packet) throws JMSException {
        checkClosed();
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            if (packet.getId() == null || packet.getId().length() == 0) {
                packet.setId(this.packetIdGenerator.generateId());
            }
            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("syncSendPacket failed with unknown exception");
            }
View Full Code Here

Examples of org.codehaus.activemq.message.Receipt

        connection.start();
        BrokerInfo info = new BrokerInfo();
        info.setBrokerName(brokerContainer.getBroker().getBrokerName());
        info.setClusterName(brokerContainer.getBroker().getBrokerClusterName());
     
        Receipt receipt = connection.syncSendRequest(info);
        if (receipt != null){
            remoteBrokerName = receipt.getBrokerName();
            remoteClusterName = receipt.getClusterName();
        }
    }
View Full Code Here

Examples of org.codehaus.activemq.message.Receipt

     * @param timeout
     * @throws JMSException
     */
    public void syncSendPacket(Packet packet, int timeout) throws JMSException {
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            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

Examples of org.codehaus.activemq.message.Receipt

    }

    public Receipt syncSendRequest(Packet packet) throws JMSException {
        checkClosed();
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            if (packet.getId() == null || packet.getId().length() == 0) {
                packet.setId(this.packetIdGenerator.generateId());
            }
            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("syncSendPacket failed with unknown exception");
            }
View Full Code Here

Examples of org.codehaus.activemq.message.Receipt

        sendReceipt(packet, null, false);
    }

    private void sendReceipt(Packet packet, Throwable requestEx, boolean failed) {
        if (packet != null && packet.isReceiptRequired()) {
            Receipt receipt = new Receipt();
            receipt.setId(this.packetIdGenerator.generateId());
            receipt.setCorrelationId(packet.getId());
            receipt.setBrokerName(brokerConnector.getBrokerInfo().getBrokerName());
            receipt.setClusterName(brokerConnector.getBrokerInfo().getClusterName());
            receipt.setException(requestEx);
            receipt.setFailed(failed);
            send(receipt);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.