Package org.apache.activemq.command

Examples of org.apache.activemq.command.Message.copy()


        // retain property set to true
        final boolean retain = retainValue != null && Boolean.parseBoolean(retainValue.toString());
        if (retain) {
            if (message.getContent().getLength() > 0) {
                // non zero length message content
                retainedMessage = message.copy();
                retainedMessage.getMessage().removeProperty(RETAIN_PROPERTY);
                retainedMessage.getMessage().setProperty(RETAINED_PROPERTY, true);
            } else {
                // clear retained message
                retainedMessage = null;
View Full Code Here


     */
    public boolean retryMessage(String messageId) throws Exception {
        Queue queue = (Queue) destination;
        Message rc = queue.getMessage(messageId);
        if (rc != null) {
            rc = rc.copy();
            rc.getMessage().setRedeliveryCounter(0);
            ActiveMQDestination originalDestination = rc.getOriginalDestination();
            if (originalDestination != null) {
                ConnectionContext context = BrokerView.getConnectionContext(broker.getContextBroker());
                return queue.moveMessageTo(context, rc, originalDestination);
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.