4949public class RpcClient {
5050 /** Channel we are communicating on */
5151 private final Channel _channel ;
52- /** Access ticket this RpcClient uses */
53- private final int _ticket ;
5452 /** Exchange to send requests to */
5553 private final String _exchange ;
5654 /** Routing key to use for requests */
@@ -67,21 +65,18 @@ public class RpcClient {
6765 private DefaultConsumer _consumer ;
6866
6967 /**
70- * Construct a new RpcClient that will communicate on the given
71- * channel, using the given ticket for permission, sending
68+ * Construct a new RpcClient that will communicate on the given channel, sending
7269 * requests to the given exchange with the given routing key.
7370 * <p>
7471 * Causes the creation of a temporary private autodelete queue.
7572 * @param channel the channel to use for communication
76- * @param ticket the access ticket for the appropriate realm
7773 * @param exchange the exchange to connect to
7874 * @param routingKey the routing key
7975 * @throws IOException if an error is encountered
8076 * @see #setupReplyQueue
8177 */
82- public RpcClient (Channel channel , int ticket , String exchange , String routingKey ) throws IOException {
78+ public RpcClient (Channel channel , String exchange , String routingKey ) throws IOException {
8379 _channel = channel ;
84- _ticket = ticket ;
8580 _exchange = exchange ;
8681 _routingKey = routingKey ;
8782 _correlationId = 0 ;
@@ -118,7 +113,7 @@ public void close() throws IOException {
118113 * @return the name of the reply queue
119114 */
120115 private String setupReplyQueue () throws IOException {
121- return _channel .queueDeclare (_ticket , "" , false , false , true , true , null ).getQueue ();
116+ return _channel .queueDeclare ("" , false , false , true , true , null ).getQueue ();
122117 }
123118
124119 /**
@@ -153,14 +148,14 @@ public void handleDelivery(String consumerTag,
153148 }
154149 }
155150 };
156- _channel .basicConsume (_ticket , _replyQueue , true , consumer );
151+ _channel .basicConsume (_replyQueue , true , consumer );
157152 return consumer ;
158153 }
159154
160155 public void publish (AMQP .BasicProperties props , byte [] message )
161156 throws IOException
162157 {
163- _channel .basicPublish (_ticket , _exchange , _routingKey , props , message );
158+ _channel .basicPublish (_exchange , _routingKey , props , message );
164159 }
165160
166161 public byte [] primitiveCall (AMQP .BasicProperties props , byte [] message )
@@ -279,14 +274,6 @@ public Channel getChannel() {
279274 return _channel ;
280275 }
281276
282- /**
283- * Retrieve the access ticket.
284- * @return the access ticket for the appropriate realm
285- */
286- public int getTicket () {
287- return _ticket ;
288- }
289-
290277 /**
291278 * Retrieve the exchange.
292279 * @return the exchange to which this client is connected
0 commit comments