Skip to content

Commit

Permalink
ARTEMIS-3556 show message protocol on message-view page
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Dondorp authored and clebertsuconic committed Nov 11, 2021
1 parent 9f6d7a0 commit dde48d0
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 0 deletions.
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 @@ -45,6 +45,7 @@
import org.apache.activemq.artemis.api.core.RefCountMessage;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;
import org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer;
import org.apache.activemq.artemis.core.message.LargeBodyReader;
Expand Down Expand Up @@ -121,6 +122,11 @@ public CoreMessage() {
this.coreMessageObjectPools = null;
}

@Override
public String getProtocolName() {
return ActiveMQClient.DEFAULT_CORE_PROTOCOL;
}

/** 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,12 @@ public class MessageInternalImpl implements MessageInternal {

private CoreMessage message;

@Override
public String getProtocolName() {
// should normally not be visible in GUI
return getClass().getName();
}

public MessageInternalImpl(ICoreMessage message) {
this.message = (CoreMessage) message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public interface CompositeDataConstants {

String ADDRESS = "address";
String MESSAGE_ID = "messageID";
String PROTOCOL = "protocol";
String USER_ID = "userID";
String TYPE = "type";
String DURABLE = "durable";
Expand All @@ -35,6 +36,7 @@ public interface CompositeDataConstants {

String ADDRESS_DESCRIPTION = "The Address";
String MESSAGE_ID_DESCRIPTION = "The message ID";
String PROTOCOL_DESCRIPTION = "The message protocol";
String USER_ID_DESCRIPTION = "The user ID";
String TYPE_DESCRIPTION = "The message type";
String DURABLE_DESCRIPTION = "Is the message durable";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ protected void init() throws OpenDataException {
addItem(CompositeDataConstants.TYPE, CompositeDataConstants.TYPE_DESCRIPTION, SimpleType.BYTE);
addItem(CompositeDataConstants.ADDRESS, CompositeDataConstants.ADDRESS_DESCRIPTION, SimpleType.STRING);
addItem(CompositeDataConstants.MESSAGE_ID, CompositeDataConstants.MESSAGE_ID_DESCRIPTION, SimpleType.STRING);
addItem(CompositeDataConstants.PROTOCOL, CompositeDataConstants.PROTOCOL_DESCRIPTION, SimpleType.STRING);
addItem(CompositeDataConstants.USER_ID, CompositeDataConstants.USER_ID_DESCRIPTION, SimpleType.STRING);
addItem(CompositeDataConstants.DURABLE, CompositeDataConstants.DURABLE_DESCRIPTION, SimpleType.BOOLEAN);
addItem(CompositeDataConstants.EXPIRATION, CompositeDataConstants.EXPIRATION_DESCRIPTION, SimpleType.LONG);
Expand Down Expand Up @@ -123,6 +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.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,11 @@ protected AMQPMessage(long messageFormat) {
this.coreMessageObjectPools = null;
}

@Override
public String getProtocolName() {
return ProtonProtocolManagerFactory.AMQP_PROTOCOL_NAME;
}

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,11 @@
// TODO: Implement this
public class OpenwireMessage implements Message {

@Override
public String getProtocolName() {
return OpenWireProtocolManagerFactory.OPENWIRE_PROTOCOL_NAME;
}

@Override
public boolean containsProperty(SimpleString key) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ private void debugList(boolean fail,

class FakeMessage implements Message {

@Override
public String getProtocolName() {
// should normally not be visible in GUI
return getClass().getName();
}

@Override
public SimpleString getReplyTo() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ class FakeMessageWithID implements Message {

final long id;

@Override
public String getProtocolName() {
// should normally not be visible in GUI
return getClass().getName();
}

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

0 comments on commit dde48d0

Please sign in to comment.