message.setAttribute(MessageAttributes.DELIVERY_ATTRIBUTE, MessageAttributes.DELIVERY_STATUS_DELIVERED); return message;
MessageAttributes successfulSend = new SimpleMessageAttributes(); String status = MessageAttributes.DELIVERY_STATUS_DELIVERED; successfulSend.setAttribute (MessageAttributes.DELIVERY_ATTRIBUTE, status); return successfulSend;
        public MessageAttributes deliverMessage(AttributedMessage message,                                                 MessageAddress dest)            throws MisdeliveredMessageException        {            //Is this a heartbeat?            boolean hbMsg = isHeartbeatMessage(message);            // -- OR --            //Is there a heartbeat piggyback vector? if so, set pbMsg = true            Object hbVector = message.getAttribute(HEARTBEAT_PIGGYBACK_VECTOR);            boolean pbMsg = (hbVector == null) ? false : true;                        //If heartbeat or piggybacking then process.            if (pbMsg || hbMsg) {                if (log.isDebugEnabled())                     log.debug("PB========= deliverMessage() found msg with heartbeats");                                 //grab HBs and sent to metric service                deliverHeartbeats((Vector)hbVector);                if (hbMsg) { // Mark HB as delivered                    message.setAttribute(MessageAttributes.DELIVERY_ATTRIBUTE, MessageAttributes.DELIVERY_STATUS_DELIVERED);                    return message; //don't deliver heartbeat msg (already sent to metric service)                }            }            //deliver message            return super.deliverMessage(message, dest);        }