Unable to create a Polling Consumer

sakshi_123
sakshi_123 Member Posts: 9
edited October 2021 in General Discussions #1

I want to create a polling consumer which is written in myFunction

the queue is : Test
and topic is abc/test

**I have also autowired PollableMessageSource source and used this polling source in my function however, it is not fetching values from topic, is my configuration incorrect? ***

spring:
cloud:
function:
definition: myFunction
stream:
binders:
solace:
environment:
solace:
java:
clientPassword:
clientUsername:
connectRetries: 0
connectRetriesPerHost: 0
host:
msgVpn:
type: solace
spring.cloud.stream.bindings.myFunction-in-0.destination: Test
spring.cloud.stream.bindings.myFunction-in-0.binder: solace
spring.cloud.stream.bindings.myFunction-in-0.group: exclusive
spring.cloud.stream.pollable-source: abc/test
spring.cloud.stream.poller.max-messages-per-poll: 1

Comments

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

    Hi @sakshi_123,

    Can you use "```" before and after your code blocks so they're easier to read? Whitespace will break yaml so we really need to be able to see your format.

    Also did you happen to see this sample app which @UshShukla created? He showed how to create a polling consumer when using Spring Cloud Stream.

    I haven't used the Pollable source feature myself, but looking at the example briefly I think your pollable-source (you have "abc/test") needs to match your binding name (you have "myfunction") in some way. It would be best to read in the Spring Cloud Stream reference guide how bindings are related to the pollable-source config.

    Hope that helps!