jbertram commented on code in PR #4710:
URL: https://github.com/apache/activemq-artemis/pull/4710#discussion_r1469884438


##########
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java:
##########
@@ -138,25 +138,71 @@ public class MQTTUtil {
 
    public static final int DEFAULT_MAXIMUM_PACKET_SIZE = MAX_PACKET_SIZE;
 
-   public static String convertMqttTopicFilterToCore(String filter, 
WildcardConfiguration wildcardConfiguration) {
-      return convertMqttTopicFilterToCore(null, filter, wildcardConfiguration);
-   }
+   public static final WildcardConfiguration MQTT_WILDCARD = new 
WildcardConfiguration().setDelimiter(SLASH).setAnyWords(HASH).setSingleWord(PLUS);
 
-   public static String convertMqttTopicFilterToCore(String prefixToAdd, 
String filter, WildcardConfiguration wildcardConfiguration) {
-      if (filter == null) {
-         return "";
+   /**
+    * This method takes the MQTT-related input and translates it into the 
proper name for a core subscription queue. The
+    * {@code topicFilter} may be either for a shared subscription in the 
format {@code $share/<shareName>/<topicFilter>}
+    * or a normal MQTT topic filter (e.g. {@code a/b/#}, {@code a/+/c}, {@code 
a/b/c}, etc.).
+    *
+    * @param topicFilter the MQTT topic filter
+    * @param clientId the MQTT client ID, used for normal (i.e. non-shared) 
subscriptions
+    * @param wildcardConfiguration the {@code WildcardConfiguration} governing 
the core broker
+    * @return the name of the core subscription queue based on the input
+    */
+   public static String getCoreQueueFromMqttTopic(String topicFilter, String 
clientId, WildcardConfiguration wildcardConfiguration) {
+      if (topicFilter == null || clientId == null || wildcardConfiguration == 
null) {
+         throw new IllegalArgumentException();

Review Comment:
   Funny. I had already started making that change!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to