Search code examples
apache-kafkasalesforcepython-asynciopython-3.7salesforce-lightning

Not able to receive message as a batch from the channel subscribed using aiosfstream, Python library for salesforce


I am trying to subscribe to a salesforce channel, I was able to get the messages from the channel. But the issue is I am getting the messages one after another, the expected way of receiving is when bulk messages are published to the channel. Need to get the messages as a whole in the subscriber.

Let's say if I publish 500 messages, I need to get whole 500 messages here on the subscriber. But I am getting one message after another.

I am using the following code

async with  client:
    for topic in get_topics(system='salesforce'):
        await client.subscribe(topic)
    async for message in client:
        messages = message

The above code is called inside async function

I am not sure this a bug from library or the method I follow is wrong

please let me know what is the issue.


Solution

  • I was able to figure out this Issue,

    It is not related to library, it is super awesome. I was able to get the message real time.

    The issue was with the architecture I have currently, which is causing the delay.

    Thank you all for the help.

    I see like it is not so good to answer this way, but answering it so that it might give someone heads up. While looking for such errors.

    They can easily start debug the architecture instead of the library.