没有从Salesforce Streaming API推送主题通道获取消息

时间:2019-08-02 18:27:25

标签: salesforce

我有一个通过Salesforce中的Workbench创建的Push主题。我可以使用C#Bayeux客户端连接到该频道,但无法从该频道接收新消息。

我的查询非常简单:-

  

从任务中选择ID,WhoId,主题

我尝试了来自可用GitHub存储库的几个代码示例,但似乎无济于事。 [https://github.com/foluis/Salesforce_PushTopics][1] [https://github.com/nthachus/CometD.NET][2]

还将我的IP地址添加到我的Salesforce实例的受信任IP

  

使用(var user = await _service.AuthenticateAsync()){

     

var pushTopicClient = new LocalBayeuxClient(user.AccessToken,   user.InstanceUrl).CreateClient();

     

var pushTopicConnection =新的PushTopicConnection(pushTopicClient);

     

pushTopicConnection.OpenClientConnection();

     

var channel = pushTopicClient.GetChannel(“ / topic / GetNewTaskNew /”);

     

channel.Subscribe(new TestMessageListener());

    // my test listener does not receive anything 
     

pushTopicConnection.CloseClientConnection();   }

没有错误/异常。当我的频道收到新消息时,什么也没有回来。

0 个答案:

没有答案