You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/02/21 19:52:41 UTC

[GitHub] [activemq] mattrpav commented on a change in pull request #729: [AMQ-8322] JMS 2.0 Implementation - First phase

mattrpav commented on a change in pull request #729:
URL: https://github.com/apache/activemq/pull/729#discussion_r807196409



##########
File path: activemq-client/src/main/java/org/apache/activemq/ActiveMQProducer.java
##########
@@ -0,0 +1,547 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jms.BytesMessage;
+import javax.jms.CompletionListener;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageFormatRuntimeException;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.util.JMSExceptionSupport;
+import org.apache.activemq.util.TypeConversionSupport;
+
+public class ActiveMQProducer implements JMSProducer {
+
+    private final ActiveMQContext activemqContext;
+    private final MessageProducer activemqMessageProducer;
+
+    // QoS override of defaults on a per-JMSProducer instance basis
+    private String correlationId = null;
+    private byte[] correlationIdBytes = null;
+    private Long deliveryDelay = null;
+    private Integer deliveryMode = null;
+    private Integer priority = null;
+    private Destination replyTo = null;
+    private Long timeToLive = null;
+    private String type = null;
+
+    // Properties applied to all messages on a per-JMS producer instance basis
+    private Map<String, Object> messageProperties = null;
+
+    ActiveMQProducer(ActiveMQContext activemqContext, MessageProducer activemqMessageProducer) {
+        this.activemqContext = activemqContext;
+        this.activemqMessageProducer = activemqMessageProducer;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Message message) {
+        try {
+            if(this.correlationId != null) {
+                message.setJMSCorrelationID(this.correlationId);
+            }
+
+            if(this.correlationIdBytes != null) {
+                message.setJMSCorrelationIDAsBytes(this.correlationIdBytes);
+            }
+
+            if(this.replyTo != null) {
+                message.setJMSReplyTo(this.replyTo);
+            }
+
+            if(this.type != null) {
+                message.setJMSType(this.type);
+            }
+
+            if(!messageProperties.isEmpty()) {
+                for(Map.Entry<String, Object> propertyEntry : messageProperties.entrySet()) {
+                    message.setObjectProperty(propertyEntry.getKey(), propertyEntry.getValue());
+                }
+            }
+
+            activemqMessageProducer.send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive());
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, String body) {
+        TextMessage textMessage = activemqContext.createTextMessage(body);
+        send(destination, textMessage);
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Map<String, Object> body) {
+        MapMessage mapMessage = activemqContext.createMapMessage();
+
+        if (body != null) {
+            try {
+               for (Map.Entry<String, Object> mapEntry : body.entrySet()) {
+                  final String key = mapEntry.getKey();
+                  final Object value = mapEntry.getValue();
+                  final Class<?> valueObject = value.getClass();
+                  if (String.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setString(key, String.class.cast(value));
+                  } else if (Integer.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setInt(key, Integer.class.cast(value));
+                  } else if (Long.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setLong(key, Long.class.cast(value));
+                  } else if (Double.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setDouble(key, Double.class.cast(value));
+                  } else if (Boolean.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setBoolean(key, Boolean.class.cast(value));
+                  } else if (Character.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setChar(key, Character.class.cast(value));
+                  } else if (Short.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setShort(key, Short.class.cast(value));
+                  } else if (Float.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setFloat(key, Float.class.cast(value));
+                  } else if (Byte.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setByte(key, Byte.class.cast(value));
+                  } else if (byte[].class.isAssignableFrom(valueObject)) {
+                      byte[] array = byte[].class.cast(value);
+                      mapMessage.setBytes(key, array, 0, array.length);
+                  } else {
+                      mapMessage.setObject(key, value);
+                  }
+               }
+            } catch (JMSException e) {
+               throw new MessageFormatRuntimeException(e.getMessage());
+            }
+         }
+         send(destination, mapMessage);
+         return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, byte[] body) {
+        BytesMessage bytesMessage = activemqContext.createBytesMessage();
+
+        try {
+            if(body != null) {
+                bytesMessage.writeBytes(body);
+            }
+            send(destination, bytesMessage);
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Serializable body) {
+        ObjectMessage objectMessage = activemqContext.createObjectMessage(body);
+        send(destination, objectMessage);
+        return this;
+    }
+
+    @Override
+    public JMSProducer setDisableMessageID(boolean value) {
+        try {
+            activemqMessageProducer.setDisableMessageID(value);
+            return this;
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public boolean getDisableMessageID() {
+        try {
+            return activemqMessageProducer.getDisableMessageID();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setDisableMessageTimestamp(boolean value) {
+        try {
+            activemqMessageProducer.setDisableMessageTimestamp(value);
+            return this;
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public boolean getDisableMessageTimestamp() {
+        try {
+            return activemqMessageProducer.getDisableMessageTimestamp();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setDeliveryMode(int deliveryMode) {
+        this.deliveryMode = deliveryMode;
+        return this;
+    }
+
+    @Override
+    public int getDeliveryMode() {
+        if(deliveryMode != null) {
+            return deliveryMode;
+        }
+
+        try {
+            return this.activemqMessageProducer.getDeliveryMode();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setPriority(int priority) {

Review comment:
       I believe the characterization of how users code to the api oversimplified. The practical reality is that many users are using frameworks (Mulesoft, Camel, etc) that swap out this type of implementation detail without user code change.
   
   I believe this is not the ticket or the place to make the change. It would be a change in product behavior and should be addressed in a follow-on JIRA.
   
   Reasoning:
   1. Out-of-range priority is quietly handled today by ActiveMQ
   2. Priority is not enabled by default by ActiveMQ for queues
   3. Having different behaviors for JMS v1 and JMS v2 is odd
   4. This would be a breaking change for framework users

##########
File path: activemq-client/src/main/java/org/apache/activemq/ActiveMQProducer.java
##########
@@ -0,0 +1,547 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jms.BytesMessage;
+import javax.jms.CompletionListener;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageFormatRuntimeException;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.util.JMSExceptionSupport;
+import org.apache.activemq.util.TypeConversionSupport;
+
+public class ActiveMQProducer implements JMSProducer {
+
+    private final ActiveMQContext activemqContext;
+    private final MessageProducer activemqMessageProducer;
+
+    // QoS override of defaults on a per-JMSProducer instance basis
+    private String correlationId = null;
+    private byte[] correlationIdBytes = null;
+    private Long deliveryDelay = null;
+    private Integer deliveryMode = null;
+    private Integer priority = null;
+    private Destination replyTo = null;
+    private Long timeToLive = null;
+    private String type = null;
+
+    // Properties applied to all messages on a per-JMS producer instance basis
+    private Map<String, Object> messageProperties = null;
+
+    ActiveMQProducer(ActiveMQContext activemqContext, MessageProducer activemqMessageProducer) {
+        this.activemqContext = activemqContext;
+        this.activemqMessageProducer = activemqMessageProducer;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Message message) {
+        try {
+            if(this.correlationId != null) {
+                message.setJMSCorrelationID(this.correlationId);
+            }
+
+            if(this.correlationIdBytes != null) {
+                message.setJMSCorrelationIDAsBytes(this.correlationIdBytes);
+            }
+
+            if(this.replyTo != null) {
+                message.setJMSReplyTo(this.replyTo);
+            }
+
+            if(this.type != null) {
+                message.setJMSType(this.type);
+            }
+
+            if(!messageProperties.isEmpty()) {
+                for(Map.Entry<String, Object> propertyEntry : messageProperties.entrySet()) {
+                    message.setObjectProperty(propertyEntry.getKey(), propertyEntry.getValue());
+                }
+            }
+
+            activemqMessageProducer.send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive());
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, String body) {
+        TextMessage textMessage = activemqContext.createTextMessage(body);
+        send(destination, textMessage);
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Map<String, Object> body) {
+        MapMessage mapMessage = activemqContext.createMapMessage();
+
+        if (body != null) {
+            try {
+               for (Map.Entry<String, Object> mapEntry : body.entrySet()) {
+                  final String key = mapEntry.getKey();
+                  final Object value = mapEntry.getValue();
+                  final Class<?> valueObject = value.getClass();
+                  if (String.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setString(key, String.class.cast(value));
+                  } else if (Integer.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setInt(key, Integer.class.cast(value));
+                  } else if (Long.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setLong(key, Long.class.cast(value));
+                  } else if (Double.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setDouble(key, Double.class.cast(value));
+                  } else if (Boolean.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setBoolean(key, Boolean.class.cast(value));
+                  } else if (Character.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setChar(key, Character.class.cast(value));
+                  } else if (Short.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setShort(key, Short.class.cast(value));
+                  } else if (Float.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setFloat(key, Float.class.cast(value));
+                  } else if (Byte.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setByte(key, Byte.class.cast(value));
+                  } else if (byte[].class.isAssignableFrom(valueObject)) {
+                      byte[] array = byte[].class.cast(value);
+                      mapMessage.setBytes(key, array, 0, array.length);
+                  } else {
+                      mapMessage.setObject(key, value);
+                  }
+               }
+            } catch (JMSException e) {
+               throw new MessageFormatRuntimeException(e.getMessage());
+            }
+         }
+         send(destination, mapMessage);
+         return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, byte[] body) {
+        BytesMessage bytesMessage = activemqContext.createBytesMessage();
+
+        try {
+            if(body != null) {
+                bytesMessage.writeBytes(body);
+            }
+            send(destination, bytesMessage);
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Serializable body) {
+        ObjectMessage objectMessage = activemqContext.createObjectMessage(body);
+        send(destination, objectMessage);
+        return this;
+    }
+
+    @Override
+    public JMSProducer setDisableMessageID(boolean value) {

Review comment:
       Yep, agreed. I'll change and add tests

##########
File path: activemq-client/src/main/java/org/apache/activemq/ActiveMQProducer.java
##########
@@ -0,0 +1,547 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jms.BytesMessage;
+import javax.jms.CompletionListener;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.MessageFormatRuntimeException;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.util.JMSExceptionSupport;
+import org.apache.activemq.util.TypeConversionSupport;
+
+public class ActiveMQProducer implements JMSProducer {
+
+    private final ActiveMQContext activemqContext;
+    private final MessageProducer activemqMessageProducer;
+
+    // QoS override of defaults on a per-JMSProducer instance basis
+    private String correlationId = null;
+    private byte[] correlationIdBytes = null;
+    private Long deliveryDelay = null;
+    private Integer deliveryMode = null;
+    private Integer priority = null;
+    private Destination replyTo = null;
+    private Long timeToLive = null;
+    private String type = null;
+
+    // Properties applied to all messages on a per-JMS producer instance basis
+    private Map<String, Object> messageProperties = null;
+
+    ActiveMQProducer(ActiveMQContext activemqContext, MessageProducer activemqMessageProducer) {
+        this.activemqContext = activemqContext;
+        this.activemqMessageProducer = activemqMessageProducer;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Message message) {
+        try {
+            if(this.correlationId != null) {
+                message.setJMSCorrelationID(this.correlationId);
+            }
+
+            if(this.correlationIdBytes != null) {
+                message.setJMSCorrelationIDAsBytes(this.correlationIdBytes);
+            }
+
+            if(this.replyTo != null) {
+                message.setJMSReplyTo(this.replyTo);
+            }
+
+            if(this.type != null) {
+                message.setJMSType(this.type);
+            }
+
+            if(messageProperties != null && !messageProperties.isEmpty()) {
+                for(Map.Entry<String, Object> propertyEntry : messageProperties.entrySet()) {
+                    message.setObjectProperty(propertyEntry.getKey(), propertyEntry.getValue());
+                }
+            }
+
+            activemqMessageProducer.send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive());
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, String body) {
+        TextMessage textMessage = activemqContext.createTextMessage(body);
+        send(destination, textMessage);
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Map<String, Object> body) {
+        MapMessage mapMessage = activemqContext.createMapMessage();
+
+        if (body != null) {
+            try {
+               for (Map.Entry<String, Object> mapEntry : body.entrySet()) {
+                  final String key = mapEntry.getKey();
+                  final Object value = mapEntry.getValue();
+                  final Class<?> valueObject = value.getClass();
+                  if (String.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setString(key, String.class.cast(value));
+                  } else if (Integer.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setInt(key, Integer.class.cast(value));
+                  } else if (Long.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setLong(key, Long.class.cast(value));
+                  } else if (Double.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setDouble(key, Double.class.cast(value));
+                  } else if (Boolean.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setBoolean(key, Boolean.class.cast(value));
+                  } else if (Character.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setChar(key, Character.class.cast(value));
+                  } else if (Short.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setShort(key, Short.class.cast(value));
+                  } else if (Float.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setFloat(key, Float.class.cast(value));
+                  } else if (Byte.class.isAssignableFrom(valueObject)) {
+                      mapMessage.setByte(key, Byte.class.cast(value));
+                  } else if (byte[].class.isAssignableFrom(valueObject)) {
+                      byte[] array = byte[].class.cast(value);
+                      mapMessage.setBytes(key, array, 0, array.length);
+                  } else {
+                      mapMessage.setObject(key, value);
+                  }
+               }
+            } catch (JMSException e) {
+               throw new MessageFormatRuntimeException(e.getMessage());
+            }
+         }
+         send(destination, mapMessage);
+         return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, byte[] body) {
+        BytesMessage bytesMessage = activemqContext.createBytesMessage();
+
+        try {
+            if(body != null) {
+                bytesMessage.writeBytes(body);
+            }
+            send(destination, bytesMessage);
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+        return this;
+    }
+
+    @Override
+    public JMSProducer send(Destination destination, Serializable body) {
+        ObjectMessage objectMessage = activemqContext.createObjectMessage(body);
+        send(destination, objectMessage);
+        return this;
+    }
+
+    @Override
+    public JMSProducer setDisableMessageID(boolean value) {
+        try {
+            activemqMessageProducer.setDisableMessageID(value);
+            return this;
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public boolean getDisableMessageID() {
+        try {
+            return activemqMessageProducer.getDisableMessageID();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setDisableMessageTimestamp(boolean value) {
+        try {
+            activemqMessageProducer.setDisableMessageTimestamp(value);
+            return this;
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public boolean getDisableMessageTimestamp() {
+        try {
+            return activemqMessageProducer.getDisableMessageTimestamp();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setDeliveryMode(int deliveryMode) {
+        this.deliveryMode = deliveryMode;
+        return this;
+    }
+
+    @Override
+    public int getDeliveryMode() {
+        if(deliveryMode != null) {
+            return deliveryMode;
+        }
+
+        try {
+            return this.activemqMessageProducer.getDeliveryMode();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setPriority(int priority) {
+        this.priority = priority;
+        return this;
+    }
+
+    @Override
+    public int getPriority() {
+        if(priority != null) {
+            return priority;
+        }
+
+        try {
+            return this.activemqMessageProducer.getPriority();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setTimeToLive(long timeToLive) {
+        this.timeToLive = timeToLive;
+        return this;
+    }
+
+    @Override
+    public long getTimeToLive() {
+        if(timeToLive != null) {
+            return timeToLive;
+        }
+
+        try {
+            return this.activemqMessageProducer.getTimeToLive();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }
+    }
+
+    @Override
+    public JMSProducer setDeliveryDelay(long deliveryDelay) {
+        this.deliveryDelay = deliveryDelay;
+        return this;
+    }
+
+    @Override
+    public long getDeliveryDelay() {
+        if(deliveryDelay != null) {
+            return deliveryDelay;
+        }
+
+        try {
+            return this.activemqMessageProducer.getDeliveryDelay();
+        } catch (JMSException e) {
+            throw JMSExceptionSupport.convertToJMSRuntimeException(e);
+        }

Review comment:
       DeliveryDelay is a separate JIRA [AMQ-8320](https://issues.apache.org/jira/browse/AMQ-8320)

##########
File path: activemq-client/src/main/java/org/apache/activemq/ActiveMQContext.java
##########
@@ -0,0 +1,477 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq;
+
+import java.io.Serializable;
+
+import javax.jms.BytesMessage;
+import javax.jms.ConnectionMetaData;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.IllegalStateRuntimeException;
+import javax.jms.JMSConsumer;
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.JMSRuntimeException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.StreamMessage;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+
+import org.apache.activemq.util.JMSExceptionSupport;
+
+/**
+ * In terms of the JMS 1.1 API a JMSContext should be thought of as 
+ * representing both a Connection and a Session. Although the simplified 
+ * API removes the need for applications to use those objects, the concepts 
+ * of connection and session remain important. A connection represents a 
+ * physical link to the JMS server and a session represents a 
+ * single-threaded context for sending and receiving messages. 
+ *
+ *
+ * @see javax.jms.JMSContext
+ */
+
+public class ActiveMQContext implements JMSContext {
+
+    private static final boolean DEFAULT_AUTO_START = true;
+
+    private final ActiveMQConnection activemqConnection;
+    private ActiveMQSession activemqSession = null;
+
+    // Configuration
+    private boolean autoStart = DEFAULT_AUTO_START;

Review comment:
       This simply hadn't been implemented in the first pass. The changes pushed today add autoStart support and unit tests verifying start=true,false and delayed starting works as expected for queueBrowse. (Consume tests to follow shortly)




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org