Ignore:
Timestamp:
06/21/13 12:42:25 (11 years ago)
Author:
stoda
Message:

Adding @MultiMethod?
Broker is not a singleton.

Location:
trunk/src/main/java/omq/client
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/omq/client/listener/ResponseListener.java

    r53 r54  
    5555        @Override
    5656        public void run() {
     57                logger.info("ResponseListener started");
    5758                Delivery delivery;
    5859                String uid_request;
     
    122123
    123124                channel.queueDeclare(reply_queue, durable, false, false, args);
     125                logger.info("ResponseListener creating queue: " + reply_queue + ", durable: " + durable);
    124126
    125127                // Declare a new consumer
  • trunk/src/main/java/omq/client/proxy/Proxymq.java

    r53 r54  
    1515import omq.Remote;
    1616import omq.client.annotation.AsyncMethod;
     17import omq.client.annotation.MultiMethod;
    1718import omq.client.annotation.SyncMethod;
    1819import omq.client.listener.ResponseListener;
     
    133134                Request request = createRequest(method, arguments);
    134135
    135                 // Log.saveTimeSendRequestLog("Client-time-request", request.getId(),
    136                 // method.getName(), timeStart);
    137 
    138136                Object response = null;
    139137                // Publish the request
     
    144142                        logger.debug("Publish sync request -> " + request.getId());
    145143                        response = publishSyncRequest(request, method.getReturnType());
    146 
    147                         // long timeEnd = (new Date()).getTime();
    148                         // Log.saveTimeSendRequestLog("Client-time-response",
    149                         // request.getId(), method.getName(), timeEnd);
    150144                }
    151145
     
    168162                // channel.basicPublish(exchange, routingkey, props, bytesRequest);
    169163                broker.getChannel().basicPublish(exchange, routingkey, props, bytesRequest);
    170                 // Log.saveLog("Client-Serialize", bytesRequest);
    171164        }
    172165
     
    203196                String corrId = java.util.UUID.randomUUID().toString();
    204197                String methodName = method.getName();
     198                boolean multi = false;
     199
     200                if (method.getAnnotation(MultiMethod.class) != null) {
     201                        multi = true;
     202                }
    205203
    206204                // Since we need to know whether the method is async and if it has to
     
    217215                        return Request.newSyncRequest(corrId, methodName, arguments, retries, timeout);
    218216                } else {
    219                         return Request.newAsyncRequest(corrId, methodName, arguments);
     217                        return Request.newAsyncRequest(corrId, methodName, arguments, multi);
    220218                }
    221219        }
     
    237235                        }
    238236                        resp = serializer.deserializeResponse(results.get(corrId), type);
    239                         // Log.saveLog("Client-Deserialize", results.get(corrId));
    240237
    241238                        // Remove and indicate the key exists (a hashmap can contain a null
Note: See TracChangeset for help on using the changeset viewer.