Ignore:
Timestamp:
07/10/13 13:14:30 (11 years ago)
Author:
stoda
Message:

Default queues added, default exchange enabled, more control in remote queues added.
Tests verified and changed Persistent test to show how to make persistent messages.

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

Legend:

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

    r82 r84  
    120120
    121121                String reply_queue = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE);
    122                 boolean durable = Boolean.parseBoolean(env.getProperty(ParameterQueue.DURABLE_QUEUES, "false"));
     122                boolean durable = Boolean.parseBoolean(env.getProperty(ParameterQueue.DURABLE_QUEUE, "false"));
     123                boolean exclusive = Boolean.parseBoolean(env.getProperty(ParameterQueue.EXCLUSIVE_QUEUE, "true"));
     124                boolean autoDelete = Boolean.parseBoolean(env.getProperty(ParameterQueue.AUTO_DELETE_QUEUE, "true"));
    123125
    124126                int ttl = Integer.parseInt(env.getProperty(ParameterQueue.MESSAGE_TTL_IN_QUEUES, "-1"));
     
    128130                }
    129131
    130                 channel.queueDeclare(reply_queue, durable, false, false, args);
    131                 logger.info("ResponseListener creating queue: " + reply_queue + ", durable: " + durable + "TTL: " + (ttl > 0 ? ttl : "not set"));
     132                if (reply_queue == null) {
     133                        reply_queue = channel.queueDeclare().getQueue();
     134                        env.setProperty(ParameterQueue.RPC_REPLY_QUEUE, reply_queue);
     135                } else {
     136                        channel.queueDeclare(reply_queue, durable, exclusive, autoDelete, args);
     137                }
     138                logger.info("ResponseListener creating queue: " + reply_queue + ", durable: " + durable + ", exclusive: " + exclusive + ", autoDelete: " + autoDelete
     139                                + ", TTL: " + (ttl > 0 ? ttl : "not set"));
    132140
    133141                // Declare a new consumer
  • trunk/src/main/java/omq/client/proxy/Proxymq.java

    r83 r84  
    9292                // this.channel = Broker.getChannel();
    9393                env = broker.getEnvironment();
    94                 exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE);
     94                exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE, "");
    9595                multiExchange = multi + uid;
    9696                replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE);
Note: See TracChangeset for help on using the changeset viewer.