Examples of onSend()


Examples of org.apache.activemq.command.ActiveMQBlobMessage.onSend()

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        ((ActiveMQConnection)connection).setCopyMessageOnSend(false);

        ActiveMQBlobMessage message = (ActiveMQBlobMessage) ((ActiveMQSession)session).createBlobMessage(file);
        message.setJMSMessageID("testmessage");
        message.onSend();
        assertEquals(ftpUrl + "ID_testmessage", message.getURL().toString());
        File uploaded = new File(ftpHomeDirFile, "ID_testmessage");
        assertTrue("File doesn't exists", uploaded.exists());
    }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBlobMessage.onSend()

        ((ActiveMQConnection)connection).setCopyMessageOnSend(false);

        ActiveMQBlobMessage message = (ActiveMQBlobMessage) ((ActiveMQSession)session).createBlobMessage(file);
        message.setJMSMessageID("testmessage");
        try {
            message.onSend();
        } catch (JMSException e) {
            e.printStackTrace();
            return;
        }
        fail("Should have failed with permission denied exception!");
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBlobMessage.onSend()

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        ((ActiveMQConnection)connection).setCopyMessageOnSend(false);
       
        ActiveMQBlobMessage message = (ActiveMQBlobMessage) ((ActiveMQSession)session).createBlobMessage(file);
        message.setMessageId(new MessageId("testmessage"));
        message.onSend();
        Assert.assertEquals(ftpUrl + "testmessage", message.getURL().toString());
        File uploaded = new File(ftpHomeDirFile, "testmessage");
        assertTrue("File doesn't exists", uploaded.exists());
  }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBlobMessage.onSend()

        ((ActiveMQConnection)connection).setCopyMessageOnSend(false);
       
        ActiveMQBlobMessage message = (ActiveMQBlobMessage) ((ActiveMQSession)session).createBlobMessage(file);
        message.setMessageId(new MessageId("testmessage"));
        try {
            message.onSend();
        } catch (JMSException e) {
            e.printStackTrace();
            return;
        }
        fail("Should have failed with permission denied exception!");
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBlobMessage.onSend()

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        ((ActiveMQConnection)connection).setCopyMessageOnSend(false);
       
        ActiveMQBlobMessage message = (ActiveMQBlobMessage) ((ActiveMQSession)session).createBlobMessage(file);
        message.setMessageId(new MessageId("testmessage"));
        message.onSend();
        Assert.assertEquals(ftpUrl + "testmessage", message.getURL().toString());
  }

}
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMapMessage.onSend()

        ActiveMQMapMessage mapMessage = new ActiveMQMapMessage();
        mapMessage.setString("String", "String");
        mapMessage.clearBody();
        assertFalse(mapMessage.isReadOnlyBody());
       
        mapMessage.onSend();
        mapMessage.setContent(mapMessage.getContent());
       
        assertNull(mapMessage.getString("String"));
        mapMessage.clearBody();
        mapMessage.setString("String", "String");
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage.onSend()

                throw new ProtocolException("Invalid transaction id: " + stompTx);
            }
            message.setTransactionId(activemqTx);
        }

        message.onSend();
        sendToActiveMQ(message, createResponseHandler(command));

    }

    protected void onStompAck(StompFrame command) throws ProtocolException {
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage.onSend()

                throw new ProtocolException("Invalid transaction id: " + stompTx);
            }
            message.setTransactionId(activemqTx);
        }

        message.onSend();
        sendToActiveMQ(message, createResponseHandler(command));

    }

    protected void onStompAck(StompFrame command) throws ProtocolException {
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage.onSend()

            msg.setTransactionId(txid);
            if (connection.isCopyMessageOnSend()) {
                msg = (ActiveMQMessage)msg.copy();
            }
            msg.setConnection(connection);
            msg.onSend();
            msg.setProducerId(msg.getMessageId().getProducerId());
            if (LOG.isTraceEnabled()) {
                LOG.trace(getSessionId() + " sending message: " + msg);
            }
            if (onComplete==null && sendTimeout <= 0 && !msg.isResponseRequired() && !connection.isAlwaysSyncSend() && (!msg.isPersistent() || connection.isUseAsyncSend() || txid != null)) {
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage.onSend()

            msg.setTransactionId(txid);
            if (connection.isCopyMessageOnSend()) {
                msg = (ActiveMQMessage)msg.copy();
            }
            msg.setConnection(connection);
            msg.onSend();
            msg.setProducerId(msg.getMessageId().getProducerId());
            if (LOG.isTraceEnabled()) {
                LOG.trace(getSessionId() + " sending message: " + msg);
            }
            if (sendTimeout <= 0 && !msg.isResponseRequired() && !connection.isAlwaysSyncSend() && (!msg.isPersistent() || connection.isUseAsyncSend() || txid != null)) {
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.