mirror of
https://github.com/apache/activemq.git
synced 2025-03-08 09:10:58 +00:00
https://issues.apache.org/jira/browse/AMQ-5391: use null or empty address to signify
anonymous-relay node, in line with expected direction for the Addressing spec underway at OASIS AMQP TC
This commit is contained in:
parent
7c1ca63d4d
commit
741b739da8
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user