How to connect to pre-provisioned queue in solace using spring cloud stream ?

chatumoh Member Posts: 7
edited April 2023 in Connectors & Integrations #1

I am using @StreamListner, created input binding of type SubscribableChannel & trying to connect to a pre-provisioned queue and used similar configurations as suggested in previous comment but i am not able to bind consumer with queue .

Getting error - "EL1008E: Property or field 'isAnonymous' cannot be found on object of type '' - maybe not public or not valid?" .

Did try providing queue-name-expression as well as string literal as suggested in blog post nothing seems to work i keep in getting above error or SpelExpression error i.e. Caused by: org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: 'rparen())' .


  • giri
    giri Member, Administrator, Employee Posts: 108 admin

    Hi @chatumoh, Can you share the application configuration snippet around the solace binding configuration?

  • chatumoh
    chatumoh Member Posts: 7
    edited April 2023 #3


    Below is the solace binder configuration which I am using in my sprint boot app.

    I gave it a try using queueNameExpression passed an SpEL expression and a hard coded literal but no luck. I am using spring-cloud-starter-stream-solace v3.4

         type: solace 
            host: tcps://
            msgVpn: <<vpnName>>
            clientUsername: <<username>>
            clientPassword: <<password>>
            connectRetries: 3 
            connectRetriesPerHost: 0 
            reconnectRetries: 3
             ssl_trust_store: '<<trust_store>>'
         destination: queueName
         group: mygroup
         binder: solace-broker
           provisionSubscriptionsToDurableQueue: false
           provisionDurableQueue: false
           queue-name-prefix: ''
           #queueNameExpression: "(properties.solace.queueNamePrefix.trim()) + (properties.solace.useGroupNameInQueueName ? group?.trim() + '-' : '')) + (properties.solace.useDestinationEncodingInQueueName ? 'plain' + '-' : '') + destination.trim().replaceAll('[*>]', '-')"
           #queueNameExpression: "'queueName'"
           useFamiliarityInQueueName: false
           useDestinationEncodingInQueueName: false
           useGroupNameInQueueName: false
           queue-additional-subscriptions: "'topic/group/>'"  
  • marc
    marc Member, Administrator, Moderator, Employee Posts: 923 admin

    Hi @chatumoh,

    Any reason you're using @StreamListener ? That way of defining a listener was deprecated quite a while ago now. I'm not sure, but that could be causing the issue with the queueNameExpression property not working.

    If you can, I would suggest moving to use Spring Cloud Function to define your message handlers. Here is an example that @giri made which shows a custom queue using them:

    Note for lowercase-in-0 all he had to do we define the properties here:

  • chatumoh
    chatumoh Member Posts: 7
    edited April 2023 #5


    I was able to connect to pre-provisioned queue after downgrading solace binder dependency to v3.2 with @StreamListener in SCST version earlier than v3.1. My microservice app is already connecting to Kafka broker using @StreamListener annotation & earlier scst version, i am adding solace as additional messaging source to read from

    As below consumer properties to disable SCST default approach of connecting to queue were deprecated since v3.3 I changed queueNameExpression and kept just the destination name in SpEL expression as well as tried just providing queueName as literal queueNameExpression: '''queuename''' but still getting same error with SCST solace binder v3.4 and v3.3

    provisionSubscriptionsToDurableQueue, queueNamePrefix, useFamiliarityInQueueName, useDestinationEncodingInQueueName, useGroupNameInQueueName