[
https://issues.apache.org/jira/browse/ARTEMIS-3113?focusedWorklogId=551270&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-551270
]
ASF GitHub Bot logged work on ARTEMIS-3113:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 11/Feb/21 12:08
Start Date: 11/Feb/21 12:08
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on a change in pull request
#3450:
URL: https://github.com/apache/activemq-artemis/pull/3450#discussion_r574450855
##########
File path:
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMessageWrapper.java
##########
@@ -137,247 +175,187 @@ public final String getJMSCorrelationID() throws
JMSException {
}
}
- @Override
- public final void setJMSCorrelationID(String correlationID) throws
JMSException {
+ public final void setJMSCorrelationID(String correlationID) {
message.setCorrelationID(correlationID);
}
- @Override
- public final Destination getJMSReplyTo() throws JMSException {
- SimpleString reply = MessageUtil.getJMSReplyTo(message);
- if (reply != null) {
- return ActiveMQDestination.fromPrefixedName(reply.toString());
- } else {
- return null;
- }
+ public final SimpleString getJMSReplyTo() {
+ return MessageUtil.getJMSReplyTo(message);
}
- @Override
- public final void setJMSReplyTo(Destination replyTo) throws JMSException {
- MessageUtil.setJMSReplyTo(message, replyTo == null ? null :
((ActiveMQDestination) replyTo).getSimpleAddress());
+ public final void setJMSReplyTo(String replyTo) {
+ MessageUtil.setJMSReplyTo(message, SimpleString.toSimpleString(replyTo));
}
- @Override
- public Destination getJMSDestination() throws JMSException {
- return ActiveMQDestination.createDestination(message.getRoutingType(),
message.getAddressSimpleString());
- }
-
- @Override
- public final void setJMSDestination(Destination destination) throws
JMSException {
- if (destination == null) {
- message.setAddress((SimpleString) null);
- } else {
- message.setAddress(((ActiveMQDestination)
destination).getSimpleAddress());
+ public SimpleString getDestination() {
+ if (message.getAddress() == null || message.getAddress().isEmpty()) {
+ return null;
}
-
+ return
SimpleString.toSimpleString(AMQPMessageSupport.destination(message.getRoutingType(),
message.getAddress()));
}
- @Override
- public final int getJMSDeliveryMode() throws JMSException {
- return message.isDurable() ? DeliveryMode.PERSISTENT :
DeliveryMode.NON_PERSISTENT;
+ public final void setDestination(String destination) {
+ message.setAddress(destination);
}
- @Override
- public final void setJMSDeliveryMode(int deliveryMode) throws JMSException {
- if (deliveryMode == DeliveryMode.PERSISTENT) {
- message.setDurable(true);
- } else if (deliveryMode == DeliveryMode.NON_PERSISTENT) {
- message.setDurable(false);
- } else {
- throw new JMSException("Invalid mode " + deliveryMode);
- }
+ public final int getJMSDeliveryMode() {
+ return message.isDurable() ? PERSISTENT : NON_PERSISTENT;
}
- @Override
- public final boolean getJMSRedelivered() throws JMSException {
- return false;
+ public final void setDeliveryMode(int deliveryMode) throws
ConversionException {
+ switch (deliveryMode) {
+ case PERSISTENT:
+ message.setDurable(true);
+ break;
+ case NON_PERSISTENT:
+ message.setDurable(false);
+ break;
+ default:
+ // There shouldn't be any other values used
+ throw new ConversionException("Invalid mode " + deliveryMode);
+ }
}
- @Override
- public final void setJMSRedelivered(boolean redelivered) throws
JMSException {
- // no op
- }
- @Override
- public final String getJMSType() throws JMSException {
+ public final String getJMSType() {
return MessageUtil.getJMSType(message);
}
- @Override
- public final void setJMSType(String type) throws JMSException {
+ public final void setJMSType(String type) {
MessageUtil.setJMSType(message, type);
}
- @Override
- public final long getJMSExpiration() throws JMSException {
+ public final long getExpiration() {
return message.getExpiration();
}
- @Override
- public final void setJMSExpiration(long expiration) throws JMSException {
+ public final void setJMSExpiration(long expiration) {
message.setExpiration(expiration);
}
- @Override
- public final long getJMSDeliveryTime() throws JMSException {
Review comment:
TTL is handled directly at the converter.this method was not being used.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 551270)
Time Spent: 13h 20m (was: 13h 10m)
> Artemis AMQP shouldn't depend on JMS
> ------------------------------------
>
> Key: ARTEMIS-3113
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3113
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: AMQP
> Affects Versions: 2.16.0
> Reporter: Emmanuel Hugonnet
> Priority: Major
> Time Spent: 13h 20m
> Remaining Estimate: 0h
>
> The converters between core messages and amqp messages depend on JMS. Since
> this is just for convenience we should remove this dependecy on an API that
> is being replaced.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)