anonymous-relay node, in line with expected direction for the Addressing spec
 underway at OASIS AMQP TC
This commit is contained in:
Dejan Bosanac 2014-11-24 15:54:52 +01:00
parent 7c1ca63d4d
commit 741b739da8
2 changed files with 1 additions and 27 deletions

View File

@ -122,8 +122,6 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
private static final Symbol COPY = Symbol.getSymbol("copy");
private static final Symbol JMS_SELECTOR = Symbol.valueOf("jms-selector");
private static final Symbol NO_LOCAL = Symbol.valueOf("no-local");
private static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("x-opt-anonymous-relay");
private static final Symbol JMS_MAPPING_VERSION = Symbol.valueOf("x-opt-jms-mapping-version");
private static final Symbol DURABLE_SUBSCRIPTION_ENDED = Symbol.getSymbol("DURABLE_SUBSCRIPTION_ENDED");
private final AmqpTransport amqpTransport;
@ -154,25 +152,10 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
this.protonTransport.setChannelMax(CHANNEL_MAX);
this.protonConnection.collect(eventCollector);
this.protonConnection.setProperties(getConnectionProperties());
updateTracer();
}
/**
* Load and return a <code>Map<Symbol, Object></code> that contains the connection
* properties which will allow the client to better communicate with this broker.
*
* @return the properties that are sent to new clients on connect.
*/
protected Map<Symbol, Object> getConnectionProperties() {
Map<Symbol, Object> properties = new HashMap<Symbol, Object>();
properties.put(ANONYMOUS_RELAY, amqpTransport.getWireFormat().getAnonymousNodeName());
return properties;
}
@Override
public void updateTracer() {
if (amqpTransport.isTrace()) {
@ -857,7 +840,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
boolean anonymous = false;
String targetNodeName = target.getAddress();
if (targetNodeName != null && targetNodeName.equals(amqpTransport.getWireFormat().getAnonymousNodeName())) {
if ((targetNodeName == null || targetNodeName.length() == 0) && !target.getDynamic()) {
anonymous = true;
} else if (target.getDynamic()) {
dest = createTempQueue();

View File

@ -40,7 +40,6 @@ public class AmqpWireFormat implements WireFormat {
private int version = 1;
private long maxFrameSize = DEFAULT_MAX_FRAME_SIZE;
private int maxAmqpFrameSize = NO_AMQP_MAX_FRAME_SIZE;
private String anonymousNodeName = "$relay";
@Override
public ByteSequence marshal(Object command) throws IOException {
@ -127,12 +126,4 @@ public class AmqpWireFormat implements WireFormat {
public void setMaxAmqpFrameSize(int maxAmqpFrameSize) {
this.maxAmqpFrameSize = maxAmqpFrameSize;
}
public String getAnonymousNodeName() {
return anonymousNodeName;
}
public void setAnonymousNodeName(String anonymousNodeName) {
this.anonymousNodeName = anonymousNodeName;
}
}