AMQP-435 RabbitMQ Client 3.4.x Compatibility

JIRA: https://jira.spring.io/browse/AMQP-435

Add ...NoWait methods to the PublisherCallbackChannelImpl.
Invoke the wait versions for now; add TODOs to change to the
...NoWait versions when 3.4.0 is the minimum client.

AMQP-435 Polishing - Add getDelegate()

Throw UnsupportedOperationException telling users to invoke
via getDelegate().

Add `What's New` notice
This commit is contained in:
Gary Russell
2014-10-23 12:00:41 +03:00
committed by Artem Bilan
parent 6b82463f58
commit fd1c08a99d
4 changed files with 74 additions and 2 deletions

View File

@@ -80,9 +80,9 @@ subprojects { subproject ->
log4jVersion = '1.2.17'
logbackVersion = '1.1.2'
mockitoVersion = '1.9.5'
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '3.3.4'
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '3.3.5'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.1.0.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.1.1.RELEASE'
springRetryVersion = '1.1.2.RELEASE'
}

View File

@@ -64,6 +64,14 @@ public interface PublisherCallbackChannel extends Channel {
*/
void addPendingConfirm(Listener listener, long seq, PendingConfirm pendingConfirm);
/**
* Use this to invoke methods on the underlying rabbit client {@link Channel} that
* are not supported by this implementation.
* @return The underlying rabbit client {@link Channel}.
* @since 1.4.
*/
Channel getDelegate();
/**
* Listeners implementing this interface can participate
* in publisher confirms received from multiple channels,

View File

@@ -558,6 +558,62 @@ public class PublisherCallbackChannelImpl
this.delegate.clearReturnListeners();
}
// @Override
public void exchangeBindNoWait(String destination, String source,
String routingKey, Map<String, Object> arguments) throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
// @Override
public void exchangeDeclareNoWait(String exchange, String type,
boolean durable, boolean autoDelete, boolean internal,
Map<String, Object> arguments) throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
// @Override
public void exchangeDeleteNoWait(String exchange, boolean ifUnused) throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
// @Override
public void exchangeUnbindNoWait(String destination, String source,
String routingKey, Map<String, Object> arguments)
throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
// @Override
public void queueBindNoWait(String queue,
String exchange, String routingKey, Map<String, Object> arguments) throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
// @Override
public void queueDeclareNoWait(String queue,
boolean durable, boolean exclusive, boolean autoDelete,
Map<String, Object> arguments)
throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
// @Override
public void queueDeleteNoWait(String queue,
boolean ifUnused, boolean ifEmpty) throws IOException {
//TODO: invoke delegate's ...NoWait when min client is 3.4.0
throw new UnsupportedOperationException("To use the ...NoWait methods, use getDelegate().");
}
public Channel getDelegate() {
return delegate;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// END PURE DELEGATE METHODS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -147,6 +147,14 @@ catch (MessageConversionException e) {
<classname>AmqpException</classname> catch block.
</para>
</section>
<section>
<title>RabbitMQ 3.4 Compatibility</title>
<para>
Now the Spring AMQP is compatible with the <emphasis>RabbitMQ 3.4</emphasis>.
However Spring AMQP still keeps the minimal RabbitMQ Client library in version
<emphasis>3.3.x</emphasis> to provide backward compatibility with legacy applications.
</para>
</section>
</section>
<section>