Examples of ActiveMQMessage


Examples of org.apache.activemq.command.ActiveMQMessage

public class LegacyFrameTranslator implements FrameTranslator {


    public ActiveMQMessage convertFrame(ProtocolConverter converter, StompFrame command) throws JMSException, ProtocolException {
        final Map<?, ?> headers = command.getHeaders();
        final ActiveMQMessage msg;
        /*
         * To reduce the complexity of this method perhaps a Chain of Responsibility
         * would be a better implementation
         */
        if (headers.containsKey(Stomp.Headers.AMQ_MESSAGE_TYPE)) {
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage

    BrokerContext brokerContext;

    public ActiveMQMessage convertFrame(ProtocolConverter converter,
            StompFrame command) throws JMSException, ProtocolException {
        Map<String, String> headers = command.getHeaders();
        ActiveMQMessage msg;
        String transformation = (String) headers.get(Stomp.Headers.TRANSFORMATION);
        if (headers.containsKey(Stomp.Headers.CONTENT_LENGTH) || transformation.equals(Stomp.Transformations.JMS_BYTE.toString())) {
            msg = super.convertFrame(converter, command);
        } else {
            HierarchicalStreamReader in;
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage

    protected void assignGroup(Subscription subs, MessageGroupMap messageGroupOwners, MessageReference n, String groupId) throws IOException {
        messageGroupOwners.put(groupId, subs.getConsumerInfo().getConsumerId());
        Message message = n.getMessage();
        if (message instanceof ActiveMQMessage) {
            ActiveMQMessage activeMessage = (ActiveMQMessage) message;
            try {
                activeMessage.setBooleanProperty("JMSXGroupFirstForConsumer", true, false);
            } catch (JMSException e) {
                LOG.warn("Failed to set boolean header: " + e, e);
            }
        }
    }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQMessage

    protected ActiveMQConnectionFactory connectionFactory;
    protected boolean topic = true;
    public PersistenceAdapterChoice defaultPersistenceAdapter = PersistenceAdapterChoice.KahaDB;

    protected ActiveMQMessage createMessage() {
        return new ActiveMQMessage();
    }
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQMessage

     * @see org.codehaus.activemq.message.PacketListener#consume(org.codehaus.activemq.message.Packet)
     */
    public void consume(Packet packet) {
        if (!closed.get() && packet != null) {
            if (packet.isJMSMessage()) {
                ActiveMQMessage message = (ActiveMQMessage) packet;
                message.setReadOnly(true);
                message.setProducerID(clientID);

                // lets check for expired messages which is only relevant for multicast based stuff
                // as a pointcast based network should filter out this stuff
                if (transportChannel.isMulticast()) {
                    long expiration = message.getJMSExpiration();
                    if (expiration > 0) {
                        long timeStamp = System.currentTimeMillis();
                        if (timeStamp > expiration) {
                            if (log.isDebugEnabled()) {
                                log.debug("Discarding expired message: " + message);
                            }
                            return;
                        }
                    }
                }

                try {
                    int count = 0;
                    for (Iterator i = this.messageDispatchers.iterator(); i.hasNext();) {
                        ActiveMQMessageDispatcher dispatcher = (ActiveMQMessageDispatcher) i.next();
                        if (dispatcher.isTarget(message)) {
                            if (count > 0) {
                                //separate message for each Session etc.
                                message = message.deepCopy();
                            }
                            dispatcher.dispatch(message);
                            count++;
                        }
                    }
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.