Custom plugin for nats push

Mohammed Azhar
Added almost 3 years ago


I have a custom plugin which is used for publishing the nats messages for each message sent if the to user is offline...The messages are sent properly but i produces a delay in the message sent and eventually causes a timeout exception...

I need to restart the server for it to continue working

I am not sure whether my approach to this is proper or not. If it is not a proper way to do this the how can i achieve it...

Any suggestion...

Thank you

Replies (3)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 3 years ago

It is hard to tell if you approach is correct as I do not know what and how you actually do. Could you clarify what produces delay and what throws timeout exception?

Added by Mohammed Azhar almost 3 years ago

If the nats connection is not availiable or slow then it causes a delay in the chat message delivery as well... is there a way to run a component which does not affect the chat message delivery and does the nats publish job independently.

That is when chat messages are sent a component will queue and publish the nats message but the actual chat messages will be delivered normally.

I am using this for the pubsub(as group chat) where most of the users will be offline, and the online uses will receive the chat message after a delay depending on the number of users in the group.

hope this clarifies what i meant.


Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 3 years ago

In this case I think you should used similar workflow as MessageArchiving component is using. MessageArchivingPlugin forwards packets to store to MessageArchivingComponent which stores them to database - in your case you would send them over nats connections.