Skip to content

Commit 4b73835

Browse files
committed
Keep only 1 ByteBuffer basicPublish method
1 parent df5fbf0 commit 4b73835

3 files changed

Lines changed: 2 additions & 159 deletions

File tree

src/main/java/com/rabbitmq/client/Channel.java

Lines changed: 2 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -300,61 +300,12 @@ void basicPublish(String exchange, String routingKey, boolean mandatory, BasicPr
300300
void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, BasicProperties props, byte[] body)
301301
throws IOException;
302302

303-
/**
304-
* Publish a message with a {@link ByteBuffer} body for zero-copy transmission.
305-
*
306-
* <p>The buffer's content between its current position and its limit will be sent.
307-
* The caller must not modify the buffer after this call returns.
308-
*
309-
* @see #basicPublish(String, String, BasicProperties, byte[])
310-
* @param exchange the exchange to publish the message to
311-
* @param routingKey the routing key
312-
* @param props other properties for the message - routing headers etc
313-
* @param body the message body
314-
* @throws java.io.IOException if an error is encountered
315-
*/
316-
default void basicPublish(String exchange, String routingKey, BasicProperties props, ByteBuffer body) throws IOException {
317-
basicPublish(exchange, routingKey, false, false, props, body, null);
318-
}
319-
320-
/**
321-
* Publish a message with a {@link ByteBuffer} body for zero-copy transmission.
322-
*
323-
* @see #basicPublish(String, String, boolean, BasicProperties, byte[])
324-
* @param exchange the exchange to publish the message to
325-
* @param routingKey the routing key
326-
* @param mandatory true if the 'mandatory' flag is to be set
327-
* @param props other properties for the message - routing headers etc
328-
* @param body the message body
329-
* @throws java.io.IOException if an error is encountered
330-
*/
331-
default void basicPublish(String exchange, String routingKey, boolean mandatory, BasicProperties props, ByteBuffer body)
332-
throws IOException {
333-
basicPublish(exchange, routingKey, mandatory, false, props, body, null);
334-
}
335-
336-
/**
337-
* Publish a message with a {@link ByteBuffer} body for zero-copy transmission.
338-
*
339-
* @see #basicPublish(String, String, boolean, boolean, BasicProperties, byte[])
340-
* @param exchange the exchange to publish the message to
341-
* @param routingKey the routing key
342-
* @param mandatory true if the 'mandatory' flag is to be set
343-
* @param immediate true if the 'immediate' flag is to be
344-
* set. Note that the RabbitMQ server does not support this flag.
345-
* @param props other properties for the message - routing headers etc
346-
* @param body the message body
347-
* @throws java.io.IOException if an error is encountered
348-
*/
349-
default void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, BasicProperties props, ByteBuffer body)
350-
throws IOException {
351-
basicPublish(exchange, routingKey, mandatory, immediate, props, body, null);
352-
}
353-
354303
/**
355304
* Publish a message with a {@link ByteBuffer} body and a {@link WriteListener} for
356305
* write completion notification.
357306
*
307+
* <p>The buffer's content between its current position and its limit will be sent.
308+
*
358309
* <p>The listener is called when the network layer has finished writing the body to the
359310
* socket. This is useful for off-heap buffers that must be released after the write completes.
360311
*
@@ -363,39 +314,6 @@ default void basicPublish(String exchange, String routingKey, boolean mandatory,
363314
*
364315
* @param exchange the exchange to publish the message to
365316
* @param routingKey the routing key
366-
* @param props other properties for the message - routing headers etc
367-
* @param body the message body
368-
* @param listener called when the write completes, may be {@code null}
369-
* @throws java.io.IOException if an error is encountered
370-
*/
371-
default void basicPublish(String exchange, String routingKey, BasicProperties props, ByteBuffer body, WriteListener listener)
372-
throws IOException {
373-
basicPublish(exchange, routingKey, false, false, props, body, listener);
374-
}
375-
376-
/**
377-
* Publish a message with a {@link ByteBuffer} body and a {@link WriteListener} for
378-
* write completion notification.
379-
*
380-
* @param exchange the exchange to publish the message to
381-
* @param routingKey the routing key
382-
* @param mandatory true if the 'mandatory' flag is to be set
383-
* @param props other properties for the message - routing headers etc
384-
* @param body the message body
385-
* @param listener called when the write completes, may be {@code null}
386-
* @throws java.io.IOException if an error is encountered
387-
*/
388-
default void basicPublish(String exchange, String routingKey, boolean mandatory, BasicProperties props, ByteBuffer body, WriteListener listener)
389-
throws IOException {
390-
basicPublish(exchange, routingKey, mandatory, false, props, body, listener);
391-
}
392-
393-
/**
394-
* Publish a message with a {@link ByteBuffer} body and a {@link WriteListener} for
395-
* write completion notification.
396-
*
397-
* @param exchange the exchange to publish the message to
398-
* @param routingKey the routing key
399317
* @param mandatory true if the 'mandatory' flag is to be set
400318
* @param immediate true if the 'immediate' flag is to be
401319
* set. Note that the RabbitMQ server does not support this flag.

src/main/java/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -720,56 +720,6 @@ public void basicPublish(String exchange, String routingKey,
720720
body == null ? null : ByteBuffer.wrap(body), null);
721721
}
722722

723-
/** Public API - {@inheritDoc} */
724-
@Override
725-
public void basicPublish(String exchange, String routingKey,
726-
BasicProperties props, ByteBuffer body)
727-
throws IOException
728-
{
729-
basicPublish(exchange, routingKey, false, false, props, body, null);
730-
}
731-
732-
/** Public API - {@inheritDoc} */
733-
@Override
734-
public void basicPublish(String exchange, String routingKey,
735-
boolean mandatory,
736-
BasicProperties props, ByteBuffer body)
737-
throws IOException
738-
{
739-
basicPublish(exchange, routingKey, mandatory, false, props, body, null);
740-
}
741-
742-
/** Public API - {@inheritDoc} */
743-
@Override
744-
public void basicPublish(String exchange, String routingKey,
745-
boolean mandatory, boolean immediate,
746-
BasicProperties props, ByteBuffer body)
747-
throws IOException
748-
{
749-
basicPublish(exchange, routingKey, mandatory, immediate, props, body, null);
750-
}
751-
752-
/** Public API - {@inheritDoc} */
753-
@Override
754-
public void basicPublish(String exchange, String routingKey,
755-
BasicProperties props, ByteBuffer body,
756-
WriteListener listener)
757-
throws IOException
758-
{
759-
basicPublish(exchange, routingKey, false, false, props, body, listener);
760-
}
761-
762-
/** Public API - {@inheritDoc} */
763-
@Override
764-
public void basicPublish(String exchange, String routingKey,
765-
boolean mandatory,
766-
BasicProperties props, ByteBuffer body,
767-
WriteListener listener)
768-
throws IOException
769-
{
770-
basicPublish(exchange, routingKey, mandatory, false, props, body, listener);
771-
}
772-
773723
/** Public API - {@inheritDoc} */
774724
@Override
775725
public void basicPublish(String exchange, String routingKey,

src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -222,31 +222,6 @@ public void basicPublish(String exchange, String routingKey, boolean mandatory,
222222
delegate.basicPublish(exchange, routingKey, mandatory, immediate, props, body);
223223
}
224224

225-
@Override
226-
public void basicPublish(String exchange, String routingKey, AMQP.BasicProperties props, ByteBuffer body) throws IOException {
227-
delegate.basicPublish(exchange, routingKey, props, body);
228-
}
229-
230-
@Override
231-
public void basicPublish(String exchange, String routingKey, boolean mandatory, AMQP.BasicProperties props, ByteBuffer body) throws IOException {
232-
delegate.basicPublish(exchange, routingKey, mandatory, props, body);
233-
}
234-
235-
@Override
236-
public void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, AMQP.BasicProperties props, ByteBuffer body) throws IOException {
237-
delegate.basicPublish(exchange, routingKey, mandatory, immediate, props, body);
238-
}
239-
240-
@Override
241-
public void basicPublish(String exchange, String routingKey, AMQP.BasicProperties props, ByteBuffer body, WriteListener listener) throws IOException {
242-
delegate.basicPublish(exchange, routingKey, props, body, listener);
243-
}
244-
245-
@Override
246-
public void basicPublish(String exchange, String routingKey, boolean mandatory, AMQP.BasicProperties props, ByteBuffer body, WriteListener listener) throws IOException {
247-
delegate.basicPublish(exchange, routingKey, mandatory, props, body, listener);
248-
}
249-
250225
@Override
251226
public void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, AMQP.BasicProperties props, ByteBuffer body, WriteListener listener) throws IOException {
252227
delegate.basicPublish(exchange, routingKey, mandatory, immediate, props, body, listener);

0 commit comments

Comments
 (0)