springcloudstream processor app listening wrong queue with appended scst/wk/

Ravi
Ravi Member Posts: 12

i have created springcloudstream processor appliation which need to listen to queue "TEMPS.Q" and publish to topic "sensor/temperature/celsius/topic"
But when i start running the application instead of listening to queue "TEMPS.Q" its creating new queue "scst/wk/PROCESSOR/plain/TEMPS.Q", so its not able to pull messages as this new queue is empty

Comments

  • JamilAhmed
    JamilAhmed Member, Employee Posts: 19 Solace Employee

    Hi @Ravi, by default the binder adds some prefixed information to the queues it creates on behalf of your application.

    These are detailed here: https://github.com/SolaceProducts/solace-spring-cloud/tree/master/solace-spring-cloud-starters/solace-spring-cloud-stream-starter#generated-queue-name-syntax

    If you want to use a queue named simply "TEMPS.Q" then you can switch off the prefixing logic by adding the following configuration parameters:

          solace:
            bindings:
              yourFunctionHere-in-0:
                consumer:
                  provisionDurableQueue: true
                  queueNamePrefix: ""
                  useFamiliarityInQueueName: false
                  useDestinationEncodingInQueueName: false
                  useGroupNameInQueueName: false
    

    If the queue is being created and managed outside of the application, then you can also stop the binder trying to provision it by this line:

                provisionDurableQueue: false
    
  • marc
    marc Member, Administrator, Moderator, Employee Posts: 954 admin

    Thanks @JamilAhmed. Correct!

    @Ravi, just a heads up that this more well defined queue naming was introduced in v2 of the Solace Binder so if you're migrating apps from V1 it is definitely something to look out for. If you are migrating I would also checkout the release notes as quite a few enhancements were made to the binder earlier this year.

  • Ravi
    Ravi Member Posts: 12

    Thanks @JamilAhmed & @marc for the details

  • Ravi
    Ravi Member Posts: 12
    edited October 2021 #5

    @marc If i need to use v2 or v2.1, what all changes i need to do below, so that it uses existing queue which is already defined in Solace VPN eg. TEMPS.Q

    stream:
      bindings:
        yourFunctionHere-in-0:
          destination: TEMPS.Q
          group: myprocessor
    solace:
        bindings:
          yourFunctionHere-in-0:
            consumer:
              autoBindErrorQueue: false
              provisionDurableQueue: false
              provisionSubscriptionsToDurableQueue: false
              queueNamePrefix: ""
              useFamiliarityInQueueName: false
              useDestinationEncodingInQueueName: false
              useGroupNameInQueueName: false
    

    After setting above properties connecting to my own solace vpn its working fine, but when i have same setting in our organization solace its not working, its trying to listen queue with name myprocessor/TEMPS.Q

    Can you plz help to resolve, why its using group name when test in our company.

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 954 admin
    edited October 2021 #6

    Hi @Ravi,

    Your configuration looks correct. If it's doing something differently when you deploy locally vs. in another environment maybe the spring config is getting overridden?

    Can you check the config in your local vs. the other environment? One way of doing this would be to enable spring boot actuator and look at the binding config directly like I showed in this post: https://solace.community/discussion/376/using-spring-boot-actuator-with-spring-cloud-stream.

    That's an older example in that post, but a newer one shows the useGroupNameInQueueName config option:

    I queried for http://localhost:8093/actuator/bindings/sink-in-0 (note default port is 8080 - mine is different) and got:

    [ {
      "bindingName" : "sink-in-0",
      "name" : "TEMPS.Q",
      "group" : "SINK",
      "pausable" : false,
      "state" : "running",
      "paused" : false,
      "extendedInfo" : {
        "bindingDestination" : "SolaceConsumerDestination[bindingDestinationName='TEMPS.Q', physicalGroupName='SINK', queueName='wk/SINK/plain/TEMPS.Q', isTemporary=false, errorQueueName='null']",
        "ExtendedConsumerProperties" : {
          "autoStartup" : true,
          "concurrency" : 5,
          "instanceCount" : 1,
          "maxAttempts" : 3,
          "backOffInitialInterval" : 1000,
          "backOffMaxInterval" : 10000,
          "backOffMultiplier" : 2.0,
          "defaultRetryable" : true,
          "extension" : {
            "provisionDurableQueue" : true,
            "provisionSubscriptionsToDurableQueue" : true,
            "queueNamePrefix" : "",
            "useFamiliarityInQueueName" : true,
            "useDestinationEncodingInQueueName" : true,
            "queueAccessType" : 0,
            "queuePermission" : 2,
            "queueDiscardBehaviour" : null,
            "queueMaxMsgRedelivery" : null,
            "queueMaxMsgSize" : null,
            "queueQuota" : null,
            "queueRespectsMsgTtl" : null,
            "polledConsumerWaitTimeInMillis" : 100,
            "flowPreRebindWaitTimeout" : 10000,
            "queueAdditionalSubscriptions" : [ "sensor/temperature/>" ],
            "useGroupNameInQueueName" : true,
            "autoBindErrorQueue" : false,
            "provisionErrorQueue" : true,
            "errorQueueNameOverride" : null,
            "useGroupNameInErrorQueueName" : true,
            "errorQueueMaxDeliveryAttempts" : 3,
            "errorQueueAccessType" : 0,
            "errorQueuePermission" : 2,
            "errorQueueDiscardBehaviour" : null,
            "errorQueueMaxMsgRedelivery" : null,
            "errorQueueMaxMsgSize" : null,
            "errorQueueQuota" : null,
            "errorQueueRespectsMsgTtl" : null,
            "errorMsgDmqEligible" : null,
            "errorMsgTtl" : null
          }
        }
      },
      "input" : true
    } ]
    
  • Ravi
    Ravi Member Posts: 12

    Hi @marc ,
    As mentioned i have enabled actuator on both office and personal solace. both giving same output expect the queue name in office solace its adding the groupname i.e, "myprocessor/TEMPS.Q" instead of "TEMPS.Q" rest all properties are same in both office and personal solace.

    {
    "bindingName" : "convertFtoC-in-0",
    "name" : "TEMPS.Q",
    "group" : "myprocessor",
    "pausable" : false,
    "state" : "running",
    "paused" : false,
    "input" : true,
    "extendedInfo" : {
    "bindingDestination" : "SolaceConsumerDestination[bindingDestinationName='TEMPS.Q', physicalGroupName='myprocessor', queueName='myprocessor/TEMPS.Q', isTemporary=false, errorQueueName='null']",
    "ExtendedConsumerProperties" : {
    "autoStartup" : true,
    "concurrency" : 1,
    "instanceCount" : 1,
    "maxAttempts" : 3,
    "backOffInitialInterval" : 1000,
    "backOffMaxInterval" : 10000,
    "backOffMultiplier" : 2.0,
    "defaultRetryable" : true,
    "extension" : {
    "provisionDurableQueue" : false,
    "provisionSubscriptionsToDurableQueue" : false,
    "queueNamePrefix" : "",
    "useFamiliarityInQueueName" : false,
    "useDestinationEncodingInQueueName" : false,
    "queueAccessType" : 0,
    "queuePermission" : 2,
    "queueDiscardBehaviour" : null,
    "queueMaxMsgRedelivery" : null,
    "queueMaxMsgSize" : null,
    "queueQuota" : null,
    "queueRespectsMsgTtl" : null,
    "polledConsumerWaitTimeInMillis" : 100,
    "flowPreRebindWaitTimeout" : 10000,
    "queueAdditionalSubscriptions" : [ ],
    "useGroupNameInQueueName" : false,
    "autoBindErrorQueue" : false,
    "provisionErrorQueue" : false,
    "errorQueueNameOverride" : null,
    "useGroupNameInErrorQueueName" : true,
    "errorQueueMaxDeliveryAttempts" : 3,
    "errorQueueAccessType" : 0,
    "errorQueuePermission" : 2,
    "errorQueueDiscardBehaviour" : null,
    "errorQueueMaxMsgRedelivery" : null,
    "errorQueueMaxMsgSize" : null,
    "errorQueueQuota" : null,
    "errorQueueRespectsMsgTtl" : null,
    "errorMsgDmqEligible" : null,
    "errorMsgTtl" : null
    }
    }
    }
    }