Skip to content

Commit

Permalink
ARTEMIS-3556 use common protocol identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Dondorp committed Nov 6, 2021
1 parent 1fe21a4 commit 8d09f20
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ default void rejectConsumer(long uniqueConsumerID) {
*/
long getMessageID();

String getProtocolName();

// used for NO-LOCAL: mainly for AMQP
default Message setConnectionID(String connectionID) {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ public CoreMessage() {
this.coreMessageObjectPools = null;
}

public String getProtocolName() {
return "CORE";
}

/** On core there's no delivery annotation */
@Override
public Object getAnnotation(SimpleString key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class MessageInternalImpl implements MessageInternal {

private CoreMessage message;

public String getProtocolName() {
return "INTERNAL";
}

public MessageInternalImpl(ICoreMessage message) {
this.message = (CoreMessage) message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected void init() throws OpenDataException {
public Map<String, Object> getFields(M m, int valueSizeLimit, int deliveryCount) throws OpenDataException {
Map<String, Object> rc = new HashMap<>();
rc.put(CompositeDataConstants.MESSAGE_ID, "" + m.getMessageID());
rc.put(CompositeDataConstants.PROTOCOL, m.getClass().getSimpleName());
rc.put(CompositeDataConstants.PROTOCOL, m.getProtocolName());
if (m.getUserID() != null) {
rc.put(CompositeDataConstants.USER_ID, "ID:" + m.getUserID().toString());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ protected AMQPMessage(long messageFormat) {
this.coreMessageObjectPools = null;
}

public String getProtocolName() {
return "AMQP";
}

public final MessageDataScanningStatus getDataScanningStatus() {
return MessageDataScanningStatus.valueOf(messageDataScanned);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
// TODO: Implement this
public class OpenwireMessage implements Message {

public String getProtocolName() {
return "OPENWIRE";
}

@Override
public boolean containsProperty(SimpleString key) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ class FakeMessageWithID implements Message {

final long id;

public String getProtocolName() {
return "FAKE";
}

@Override
public SimpleString getReplyTo() {
return null;
Expand Down

0 comments on commit 8d09f20

Please sign in to comment.