Package org.activemq.message

Examples of org.activemq.message.KeepAlive


        Properties headers = parser.parse(in);
        while (in.readByte() != 0) {}

        if (format.isInTransaction())
        {
            return new PacketEnvelope(new KeepAlive(), headers);
        }
        TransactionInfo tx = new TransactionInfo();
        String tx_id = StompWireFormat.clientIds.generateId();
        format.setTransactionId(tx_id);
        tx.setTransactionId(tx_id);
View Full Code Here


     * validate the connection
     * @param timeout
     * @throws JMSException
     */
  public void validateConnection(int timeout) throws JMSException {
    KeepAlive packet = new KeepAlive();
    packet.setReceiptRequired(true);
    packet.setId(this.packetIdGenerator.getNextShortSequence());
    // In most cases, if the transport is dead due to network errors
    // the network error will be recognised immediately and an exception
    // thrown. If the duplicate client ids are due to misconfiguration,
    // we make sure that we do not terminate the "right" connection
    // prematurely by using a long timeout here. If the existing client
View Full Code Here

     * validate the connection
     * @param timeout
     * @throws JMSException
     */
  public void validateConnection(int timeout) throws JMSException {
    KeepAlive packet = new KeepAlive();
    packet.setReceiptRequired(true);
    packet.setId(this.packetIdGenerator.getNextShortSequence());
    // In most cases, if the transport is dead due to network errors
    // the network error will be recognised immediately and an exception
    // thrown. If the duplicate client ids are due to misconfiguration,
    // we make sure that we do not terminate the "right" connection
    // prematurely by using a long timeout here. If the existing client
View Full Code Here

     * validate the connection
     * @param timeout
     * @throws JMSException
     */
  public void validateConnection(int timeout) throws JMSException {
    KeepAlive packet = new KeepAlive();
    packet.setReceiptRequired(true);
    packet.setId(this.packetIdGenerator.getNextShortSequence());
    // In most cases, if the transport is dead due to network errors
    // the network error will be recognised immediately and an exception
    // thrown. If the duplicate client ids are due to misconfiguration,
    // we make sure that we do not terminate the "right" connection
    // prematurely by using a long timeout here. If the existing client
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new KeepAlive();
    }
View Full Code Here

        } else {
            // Then it should be active
            // Keep pinging the channel periodically
            if ((channel.getLastReceiptTimestamp() + channel.getKeepAliveTimeout()) < System.currentTimeMillis()) {
                log.debug("Sending keep-alive on channel " + channel.toString());
                KeepAlive packet = new KeepAlive();
                packet.setReceiptRequired(true);
                boolean wasConnected = channel.isTransportConnected();
                try {
                    channel.asyncSendWithReceipt(packet);
                    zombieChannelSuspects.add(channel);
                } catch (JMSException e) {
View Full Code Here

     * validate the connection
     * @param timeout
     * @throws JMSException
     */
  public void validateConnection(int timeout) throws JMSException {
    KeepAlive packet = new KeepAlive();
    packet.setReceiptRequired(true);
    packet.setId(this.packetIdGenerator.getNextShortSequence());
    // In most cases, if the transport is dead due to network errors
    // the network error will be recognised immediately and an exception
    // thrown. If the duplicate client ids are due to misconfiguration,
    // we make sure that we do not terminate the "right" connection
    // prematurely by using a long timeout here. If the existing client
View Full Code Here

        assertTrue("Exceptions were thrown: " + exceptions, exceptions.size() == 0);
    }

    public void testAsyncSendWithReceipt() throws Exception {
        sendReceipts = true;
        Packet packet = new KeepAlive();
        packet.setId((short) 1);
        ReceiptHolder rh = sender.asyncSendWithReceipt(packet);
        Receipt result = rh.getReceipt(5000);
        if (result == null) {
            fail("Should have gotten receipt");
        }
View Full Code Here

TOP

Related Classes of org.activemq.message.KeepAlive

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.