Closed guruprasad83 closed 6 years ago
I had the same issue and implemented/added an extension, that raises an event in which i than restart the connection (auth + subscription)
https://github.com/Oyatel/CometD.NET/issues/3#issuecomment-389085182
@ohaucke - Thanks for your comment. Actually after some more research it's working now for me. Here are the changes to be done (in case if anyone wants)
@guruprasad83 / @ohaucke : I am also getting the same issue.
I have added the code in the event handler to handshake and subscribe channel (pushTopicConnection.Connect method) in the raised event as you mentioned above but still, it's not working. Is there anything else I need to do or i am missing something?
Thanks In Advance
@Rajat-Jindal - see the steps below
@guruprasad83 I am trying to add handshakelistener as per your above comments but not sure if i am missing something. I am also using .net library you mentioned.
My code is - this.bayeuxClient.GetChannel("/meta/connect").AddListener(new Listener()); this.bayeuxClient.GetChannel("/meta/handshake").AddListener(new Listener());
where Listener.cs is
public class Listener : IMessageListener
{
public void OnMessage(IClientSessionChannel channel, IMessage message)
{
Console.WriteLine(message.Json);
}
}
I am not getting events on neither of channel.
nvm. i figured it out. i had put above lines before this.bayeuxClient.Handshake();
@Rajat-Jindal - see the steps below
- Create a bayeuxclient by passing salesforce accesstoken and url
- once bayeuxclient created, add an event listener for handshake channel like below bayeuxClient.getChannel("/meta/handshake").addListener(handshakeListener); where handshakeListener is an event listener (HandShakeChannelListener)
- on success event of handshakeListener, you subscribe to pushtopics
Hi @guruprasad83 , I've the same issue, I'm reviewing this issues and I've the following doubts, this is my use case I've have an app to handle the connection to multiple channels of the same instance (channel1, channel2, ...channelN), the connection to each channel happens by demand, it means depends of the user actions, so currently I've a bayeuxClient by Channel.
So,
My apologizes, I'm a little confused with this.
Thanks
I have my .net client (windows service) which subscribe for Salesforce streaming API push topics using this cometd.net.
I am able to connect to Salesforce and can get the notifications to my client. everything is working fine. but
when there is no activity on the channel (no changes for salesforce object) after some time (maybe 2 hours) if I update the object am not receiving any notification from salesforce. I had tried putting listeners to log and in the logs it says below
so as per the log, sometimes I get "403::Unknown client" but immediately after that it says again channel successful. But as I said when I try updating salesforce object after 2 hours (as per log, it is in connection successful) I am not receiving any notification.
If I restart my windows service and gets the notification again.
Any help would be greatly appreciated Sorry if I post it here as i did not get any solution so.