45
45
* </ul>
46
46
* <p>
47
47
*
48
- * While a Channel can be used by multiple threads, it's important to ensure
49
- * that only one thread executes a command at once. Concurrent execution of
50
- * commands will likely cause an UnexpectedFrameError to be thrown.
48
+ * <p>
49
+ * {@link Channel} instances are safe for use by multiple
50
+ * threads. Requests into a {@link Channel} are serialized, with only one
51
+ * thread running commands at a time.
52
+ * As such, applications may prefer using a {@link Channel} per thread
53
+ * instead of sharing the same <code>Channel</code> across multiple threads.
54
+ *
55
+ * An <b>important caveat</b> to this is that confirms are <b>not</b> handled
56
+ * properly when a {@link Channel} is shared between multiple threads. In that
57
+ * scenario, it is therefore important to ensure that the {@link Channel}
58
+ * instance is <b>not</b> accessed concurrently by multiple threads.
51
59
*
52
60
*/
53
61
@@ -231,7 +239,7 @@ public interface Channel extends ShutdownNotifier {
231
239
void basicQos (int prefetchCount ) throws IOException ;
232
240
233
241
/**
234
- * Publish a message with both "mandatory" and "immediate" flags set to false
242
+ * Publish a message
235
243
* @see com.rabbitmq.client.AMQP.Basic.Publish
236
244
* @param exchange the exchange to publish the message to
237
245
* @param routingKey the routing key
@@ -246,8 +254,22 @@ public interface Channel extends ShutdownNotifier {
246
254
* @see com.rabbitmq.client.AMQP.Basic.Publish
247
255
* @param exchange the exchange to publish the message to
248
256
* @param routingKey the routing key
249
- * @param mandatory true if we are requesting a mandatory publish
250
- * @param immediate true if we are requesting an immediate publish
257
+ * @param mandatory true if the 'mandatory' flag is to be set
258
+ * @param props other properties for the message - routing headers etc
259
+ * @param body the message body
260
+ * @throws java.io.IOException if an error is encountered
261
+ */
262
+ void basicPublish (String exchange , String routingKey , boolean mandatory , BasicProperties props , byte [] body )
263
+ throws IOException ;
264
+
265
+ /**
266
+ * Publish a message
267
+ * @see com.rabbitmq.client.AMQP.Basic.Publish
268
+ * @param exchange the exchange to publish the message to
269
+ * @param routingKey the routing key
270
+ * @param mandatory true if the 'mandatory' flag is to be set
271
+ * @param immediate true if the 'immediate' flag is to be
272
+ * set. Note that the RabbitMQ server does not support this flag.
251
273
* @param props other properties for the message - routing headers etc
252
274
* @param body the message body
253
275
* @throws java.io.IOException if an error is encountered
@@ -347,9 +369,9 @@ Exchange.DeclareOk exchangeDeclare(String exchange,
347
369
* Bind an exchange to an exchange, with no extra arguments.
348
370
* @see com.rabbitmq.client.AMQP.Exchange.Bind
349
371
* @see com.rabbitmq.client.AMQP.Exchange.BindOk
350
- * @param destination: the name of the exchange to which messages flow across the binding
351
- * @param source: the name of the exchange from which messages flow across the binding
352
- * @param routingKey: the routine key to use for the binding
372
+ * @param destination the name of the exchange to which messages flow across the binding
373
+ * @param source the name of the exchange from which messages flow across the binding
374
+ * @param routingKey the routine key to use for the binding
353
375
* @return a binding-confirm method if the binding was successfully created
354
376
* @throws java.io.IOException if an error is encountered
355
377
*/
@@ -359,10 +381,10 @@ Exchange.DeclareOk exchangeDeclare(String exchange,
359
381
* Bind an exchange to an exchange.
360
382
* @see com.rabbitmq.client.AMQP.Exchange.Bind
361
383
* @see com.rabbitmq.client.AMQP.Exchange.BindOk
362
- * @param destination: the name of the exchange to which messages flow across the binding
363
- * @param source: the name of the exchange from which messages flow across the binding
364
- * @param routingKey: the routine key to use for the binding
365
- * @param arguments: other properties (binding parameters)
384
+ * @param destination the name of the exchange to which messages flow across the binding
385
+ * @param source the name of the exchange from which messages flow across the binding
386
+ * @param routingKey the routine key to use for the binding
387
+ * @param arguments other properties (binding parameters)
366
388
* @return a binding-confirm method if the binding was successfully created
367
389
* @throws java.io.IOException if an error is encountered
368
390
*/
@@ -372,9 +394,9 @@ Exchange.DeclareOk exchangeDeclare(String exchange,
372
394
* Unbind an exchange from an exchange, with no extra arguments.
373
395
* @see com.rabbitmq.client.AMQP.Exchange.Bind
374
396
* @see com.rabbitmq.client.AMQP.Exchange.BindOk
375
- * @param destination: the name of the exchange to which messages flow across the binding
376
- * @param source: the name of the exchange from which messages flow across the binding
377
- * @param routingKey: the routine key to use for the binding
397
+ * @param destination the name of the exchange to which messages flow across the binding
398
+ * @param source the name of the exchange from which messages flow across the binding
399
+ * @param routingKey the routine key to use for the binding
378
400
* @return a binding-confirm method if the binding was successfully created
379
401
* @throws java.io.IOException if an error is encountered
380
402
*/
@@ -384,10 +406,10 @@ Exchange.DeclareOk exchangeDeclare(String exchange,
384
406
* Unbind an exchange from an exchange.
385
407
* @see com.rabbitmq.client.AMQP.Exchange.Bind
386
408
* @see com.rabbitmq.client.AMQP.Exchange.BindOk
387
- * @param destination: the name of the exchange to which messages flow across the binding
388
- * @param source: the name of the exchange from which messages flow across the binding
389
- * @param routingKey: the routine key to use for the binding
390
- * @param arguments: other properties (binding parameters)
409
+ * @param destination the name of the exchange to which messages flow across the binding
410
+ * @param source the name of the exchange from which messages flow across the binding
411
+ * @param routingKey the routine key to use for the binding
412
+ * @param arguments other properties (binding parameters)
391
413
* @return a binding-confirm method if the binding was successfully created
392
414
* @throws java.io.IOException if an error is encountered
393
415
*/
0 commit comments