🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

Consuming messages a predefined solace queue using Spring Cloud Stream

Hello Solace Community,

I'm brand new to solace product, but I set up a solace Kubernetes instance with a VPN relatively easy with the community documentation and publish to topics and subscribe from queues fairly quickly with the Python provided examples.
(see guaranteed_publisher.py, guaranteed_subscriber.py)

Now I'm trying to consume the messages with Spring Cloud Stream, but I cannot consume the messages from the predefined queue. Somehow the Solace Queue Provisioner is automatically subscribing to a self-defined queue.

2021-12-03 09:58:49.353  INFO 12134 --- [  restartedMain] c.s.s.c.s.b.i.JCSMPInboundChannelAdapter : Creating 1 consumer flows for queue > #P2P/QTMP/v:aims-solace-pubsubplus-0/scst/an/6964a1b9-6119-4ae2-89f0-e12652c9aba3/plain/aims.import.queue.article <inbound adapter d7964626-8ab8-4489-92ed-9d53c2c722d9>

The idea is that the Spring Cloud Stream consumer retrieves the messages from aims.import.queue.article.

Is there any way to force this?

Here are the properties I've tried so far.

spring.cloud.stream.bindings.articleConsumeSolace-in-0.destination=aims.import.queue.article
spring.cloud.stream.bindings.articleConsumeSolace-in-0.group=
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.concurrency=1

spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.autoBindErrorQueue=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useGroupNameInErrorQueueName=false

spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.provisionSubscriptionsToDurableQueue=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.provisionDurableQueue=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.queueNamePrefix=
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useFamiliarityInQueueName=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useDestinationEncodingInQueueName=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useGroupNameInQueueName=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.queueAccessType=false
spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.queuePermission=false

References

Best Answers

  • glenn_esl
    glenn_esl Member Posts: 9
    #2 Answer ✓

    Ok, I don't know why

    application.properties is not working

    spring.cloud.function.definition=articleConsumeSolace
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.destination=aims.import.queue.article
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.group=nonexclusive
    
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.provisionSubscriptionsToDurableQueue=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.provisionDurableQueue=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.queueNamePrefix=
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useFamiliarityInQueueName=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useDestinationEncodingInQueueName=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useGroupNameInQueueName=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.content-type=application/json
    

    application.yml is working :/

    spring:
      cloud:
        function:
          definition: articleConsumeSolace
        stream:
          bindings:
            articleConsumeSolace-in-0:
              destination: aims.import.queue.article
              group: nonexclusive
          solace:
            bindings:
              articleConsumeSolace-in-0:
                consumer:
                  provisionSubscriptionsToDurableQueue: false
                  provisionDurableQueue: false
                  queueNamePrefix: ""
                  useFamiliarityInQueueName: false
                  useDestinationEncodingInQueueName: false
                  useGroupNameInQueueName: false
                  content-type: "application/json"
    

    I'm assuming it has to do with queueNamePrefix= or queueNamePrefix="" is not working...

  • ivan_lkc
    ivan_lkc Member Posts: 11 ✭✭
    #3 Answer ✓

    The properties & yaml you shown are not identical. ("stream.bindings" versus "stream.solace.bindings")

  • glenn_esl
    glenn_esl Member Posts: 9
    #4 Answer ✓

    @ivan_lkc , thanks for pointing out this simple mistake...

    it's working properties as well :)

    spring.cloud.function.definition=articleConsumeSolace
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.destination=aims.import.queue.article
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.group=nonexclusive
    
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.provisionSubscriptionsToDurableQueue=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.provisionDurableQueue=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.queueNamePrefix=
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.useFamiliarityInQueueName=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.useDestinationEncodingInQueueName=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.useGroupNameInQueueName=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.content-type=application/json
    
    

Answers

  • glenn_esl
    glenn_esl Member Posts: 9
    #5 Answer ✓

    Ok, I don't know why

    application.properties is not working

    spring.cloud.function.definition=articleConsumeSolace
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.destination=aims.import.queue.article
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.group=nonexclusive
    
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.provisionSubscriptionsToDurableQueue=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.provisionDurableQueue=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.queueNamePrefix=
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useFamiliarityInQueueName=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useDestinationEncodingInQueueName=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.useGroupNameInQueueName=false
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.consumer.content-type=application/json
    

    application.yml is working :/

    spring:
      cloud:
        function:
          definition: articleConsumeSolace
        stream:
          bindings:
            articleConsumeSolace-in-0:
              destination: aims.import.queue.article
              group: nonexclusive
          solace:
            bindings:
              articleConsumeSolace-in-0:
                consumer:
                  provisionSubscriptionsToDurableQueue: false
                  provisionDurableQueue: false
                  queueNamePrefix: ""
                  useFamiliarityInQueueName: false
                  useDestinationEncodingInQueueName: false
                  useGroupNameInQueueName: false
                  content-type: "application/json"
    

    I'm assuming it has to do with queueNamePrefix= or queueNamePrefix="" is not working...

  • ivan_lkc
    ivan_lkc Member Posts: 11 ✭✭
    #6 Answer ✓

    The properties & yaml you shown are not identical. ("stream.bindings" versus "stream.solace.bindings")

  • glenn_esl
    glenn_esl Member Posts: 9
    #7 Answer ✓

    @ivan_lkc , thanks for pointing out this simple mistake...

    it's working properties as well :)

    spring.cloud.function.definition=articleConsumeSolace
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.destination=aims.import.queue.article
    spring.cloud.stream.bindings.articleConsumeSolace-in-0.group=nonexclusive
    
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.provisionSubscriptionsToDurableQueue=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.provisionDurableQueue=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.queueNamePrefix=
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.useFamiliarityInQueueName=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.useDestinationEncodingInQueueName=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.useGroupNameInQueueName=false
    spring.cloud.stream.solace.bindings.articleConsumeSolace-in-0.consumer.content-type=application/json