Ignore:
Timestamp:
10/19/13 13:20:44 (11 years ago)
Author:
stoda
Message:

Error detected: there should be only one thread listening to the multiexchange queue.
TODO: change this. Make refactor in the invocationthread. Change remotethreadpool to achieve this behavior.
AInvocationThread <- InvocationTHread

<- MultiInvocationTHread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/supervisor/src/main/java/omq/client/proxy/Proxymq.java

    r105 r107  
    4747
    4848        private String reference;
     49        private String UID;
    4950        private transient String exchange;
    5051        private transient String multiExchange;
     
    7273         * Proxymq Constructor.
    7374         *
    74          * This constructor uses an reference to know which object will call. It also uses
    75          * Properties to set where to send the messages
     75         * This constructor uses an reference to know which object will call. It
     76         * also uses Properties to set where to send the messages
    7677         *
    7778         * @param reference
    78          *            The reference represents the unique identifier of a remote object
     79         *            The reference represents the unique identifier of a remote
     80         *            object
    7981         * @param clazz
    8082         *            It represents the real class of the remote object. With this
     
    119121                                return getRef();
    120122                        }
     123                        if (methodName.equals("getUID")) {
     124                                return getUID();
     125                        }
     126                        if (methodName.equals("setUID")) {
     127                                setUID((String) arguments[0]);
     128                                return null;
     129                        }
    121130                        if (methodName.equals("equals")) {
    122131                                if (arguments[0] instanceof Remote) {
     
    168177                }
    169178
     179                // TODO look this carefully
     180                String appId = UID == null ? reference : UID;
     181
    170182                // Add the correlation ID and create a replyTo property
    171                 BasicProperties props = new BasicProperties.Builder().appId(reference).correlationId(corrId).replyTo(replyQueueName).type(serializerType)
    172                                 .deliveryMode(deliveryMode).build();
     183                BasicProperties props = new BasicProperties.Builder().appId(appId).correlationId(corrId).replyTo(replyQueueName)
     184                                .type(serializerType).deliveryMode(deliveryMode).build();
    173185
    174186                // Publish the message
    175187                byte[] bytesRequest = serializer.serialize(serializerType, request);
    176188                broker.publishMessge(exchange, routingkey, props, bytesRequest);
    177                 logger.debug("Proxymq: " + reference + " invokes '" + request.getMethod() + "' , corrID: " + corrId + ", exchange: " + exchange + ", replyQueue: "
    178                                 + replyQueueName + ", serializerType: " + serializerType + ", multi call: " + request.isMulti() + ", async call: " + request.isAsync()
    179                                 + ", delivery mode: " + deliveryMode);
     189                logger.debug("Proxymq: " + reference + " invokes '" + request.getMethod() + "' , corrID: " + corrId + ", exchange: " + exchange
     190                                + ", replyQueue: " + replyQueueName + ", serializerType: " + serializerType + ", multi call: " + request.isMulti()
     191                                + ", async call: " + request.isAsync() + ", delivery mode: " + deliveryMode);
    180192        }
    181193
     
    362374        }
    363375
     376        @Override
     377        public String getUID() {
     378                return UID;
     379        }
     380
     381        @Override
     382        public void setUID(String uID) {
     383                this.UID = uID;
     384        }
     385
    364386}
Note: See TracChangeset for help on using the changeset viewer.