Questions tagged [cometd]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
23 views

CometD in Salesforce Mobile?

I have an app using empApi for desktop subscription to a Platform Event, and the version for Communities replaces empApi with cometD. I'm struggling to find an option for Salesforce Mobile. empApi ...
user avatar
0 votes
0 answers
23 views

Not able to subscribe to Platform events using cometD in visualforce or force.com site [duplicate]

I am trying to subscribe to a Platform event in force.com site page in visualforce page. I am using cometD to subscribe.Using below code. It works internally in org. But when using the page on site ...
user avatar
0 votes
0 answers
286 views

Error: Cannot read properties of undefined (reading 'cometd') when trying to load CometD in LWC

I want to subscribe to events in a community using the CometD library. Unfortunately when loading the script I get following error: "Error: Cannot read properties of undefined (reading 'cometd')&...
user avatar
  • 101
0 votes
0 answers
89 views

How to set replayId '-2' using cometD?

Where can I set replayId to get all events? Now I am getting only new events. import { LightningElement, track, wire, api } from 'lwc'; import { loadScript } from "lightning/...
user avatar
  • 13
1 vote
0 answers
477 views

How to set up cometD work with Salesforce?

I need help! I am using new community template and I need to show notifications. Community licenses don't support Streaming API, therefor empApi doesn't work. I have to use cometD I am trying to use ...
user avatar
  • 13
0 votes
1 answer
153 views

403::Unknown client - error in cometd subscription response

Im getting a 403::Unknown client error in the response for my subscription request. I handshake no problem. Then i use the clientId from the handshake response in my subscription request but i get ...
user avatar
4 votes
0 answers
57 views

How to handle Platform Event while UI is being rerendered?

Use case: We have Digital Experience (i.e Community) where at first we perform the action and after it, we redirect to a new page. This action also publishes Platform Event (Notification) which should ...
user avatar
  • 4,157
2 votes
1 answer
260 views

What CometD streaming channels do communities support?

Is there any documentation that says what streaming channels are allowed for communities? (Note that in communities lightning-emp-api methods such as isEmpEnabled never resolve but it is possible to ...
user avatar
  • 131k
1 vote
1 answer
604 views

Calling LWC Javascript function from subscribe () method of cometd result in function undefined

Calling the LWC Javascript function from the subscribe() method of CometD results in function undefined. Here is the code: <code> import { LightningElement, api, track, wire } from 'lwc'; ...
user avatar
1 vote
1 answer
435 views

Streaming API - How do I automatically queue a retry of a failed messages?

I have an implementation of the streaming api using the .NET CometD client to receive PushTopic changes from a Salesforce platform application. Due to the nature of the process it will in turn ...
user avatar
  • 287
1 vote
0 answers
220 views

Salesforce Streaming / CometD Scaling

Since CometD is a client / server implementation, i.e. messages flow directly from SalesForce into subscribed clients, I'm wondering what options there might be regarding horizontal scaling of the ...
user avatar
  • 11
1 vote
0 answers
397 views

CometD EMP Connector constantly disconnecting after ~6 hours [closed]

I'm using the Java EMP connector to subscribe to a push topic in our Salesforce instance. The only issue I'm having is that the Connector keeps disconnecting itself after roughly 6 hours (always on ...
user avatar
1 vote
1 answer
29 views

How to restrict access to CometD clients to certain Platform Events?

I need to publish multiple events, with different clients subscribing to different type of events. Is there a way to implement policies / permissions to different Channels? So I can restrict clients ...
user avatar
0 votes
0 answers
44 views

Publish Platform Event in SF org and subscribe to it in other org [duplicate]

The requirement is to publish a platform event in one salesforce org and subscribe to it in another salesforce org. In simple words, I need to publish a platform event from a salesforce app/org for an ...
user avatar
0 votes
0 answers
44 views

Cometd does not receive messages on a Filtered Pushtopic for custom profile

I have a lightning cometd. When I use pushtopic without filter for a custom profile it works. When I add filter, it does not receive the messages. If I login as system admin, the filtered pushtopic ...
user avatar
1 vote
2 answers
1k views

Publishing an event to Salesforce via CometD

I am trying to create a external client to publish Platform events to Salesforce event bus. I have used REST API to do the same but I wanted to do it via a true 'Publish'. My guess is that this will ...
user avatar
  • 66
1 vote
0 answers
335 views

Platform Event Limits regarding CometD and non-CometD clients

As per the Salesforce Documentation regarding Platform Event limits, in Performance or Unlimited Editions of Salesforce, maximum number of delivered event notifications within a 24-hour period, ...
user avatar
  • 1,252
5 votes
1 answer
6k views

Platform Event stuck in OPERATION_ENQUEUED status?

I've created a platform event called Review_Event__e in my sandbox, I have a apex class that publishes an event, the debug logs the event was successfully committed but if I monitor Workbench ...
user avatar
5 votes
1 answer
383 views

Streaming API Message Reliability and Acknowledgement

How does the Salesforce streaming API ensure message reliability? I understand you can replay events from any replay id within the retention period, but this does not guarantee message delivery. ...
user avatar
2 votes
1 answer
117 views

cometD does not work in incognito mode [closed]

this is my code renderedCallback() { console.log('render'); if(!this.isUserGuest) { getSessionId() .then(result => { this.sessionId = ...
user avatar
  • 683
1 vote
1 answer
171 views

Is Salesforce classed as a consumer of Platform events?

As the title suggests, I would like to know if Salesforce is classed as a CometD subscriber to Platform events? In the documentation it mentions there is 25K message limit divided by subscribers, is ...
user avatar
5 votes
1 answer
2k views

Consuming platform events on AWS

Salesforce and Amazon announced earlier this year there is a partnership to allow easier sync between the two tech stacks. I recall in a YouTube video AWS product engineers will be able to consume ...
user avatar
0 votes
1 answer
463 views

Getting "has established a session, but no BAYEUX_BROWSER cookie present" When Connecting To Platform Events Channel

I am working with this Ruby library (https://github.com/restforce/restforce#streaming) to connect to Salesforce's Platform Events. Here is my code: EM.run do client.subscribe '/event/My_Event', ...
user avatar
  • 113
2 votes
1 answer
953 views

Issue with platform event Subscription

A platform event is publishing through an apex trigger and I am trying to subscribe to it using a lightning component, but the lightning component is failing to subscribe every time. It is subscribing ...
user avatar
1 vote
0 answers
450 views

Authentication error when connecting to the Streaming API

I want to subscribe to PushTopic events from my Open CTI application. But I can't even connect to a cometd server. Help me find the problem with my solution. Or maybe there are other ways to subscribe ...
user avatar
2 votes
0 answers
326 views

CometD & empAPI Issues when subscribing to Platform Events [closed]

As we are using Cometd and platform Events to get the communication happen between Asynchronous Apex and Lightning Component(Lightning Out) it's working fine for some times, and getting the following ...
user avatar
1 vote
0 answers
401 views

Platform event subscribers on Visualforce page not being called always when platform event is published

We have an implementation in which there are multiple Visualforce pages(seven pages). These pages are using platform events to communicate between each other. The JavaScript code to subscribe to ...
user avatar
  • 731
6 votes
0 answers
312 views

lightning:empApi is not working in summer19's sandbox: 403::Unknown client

I am receiving errors in lightning:empApi in the console. It was working fine before summer19 release in the sandbox. It works fine in scratch org. Scratch org is also on summer19. The error is ...
user avatar
1 vote
1 answer
1k views

How to solve inconsistent 403::Unknown Client error on subscribe when using lightning:empApi

Every other time I attempt to use the lightning:empApi component to subscribe to a Push Topic channel the EMP API component reports error '403::Unknown Client' After the EMP API component reports the ...
user avatar
  • 757
1 vote
0 answers
810 views

Understanding who is consuming Platform Events, and how much, is it possible?

When a platform event is fired, it is consumed from whichever client is subscribed to its specific channel. If a single event is fired and consumed by 5 consumers, it will count 5 against the Daily ...
user avatar
1 vote
0 answers
91 views

Unable to set component attribute on message received from lightning:empAPI

I have the following lightning component implemented and when a message is received I can obtain attribute data from the component but when trying to set an attribute it doesn't seem to set it, the ...
user avatar
11 votes
1 answer
2k views

Cannot subscribe to platform events using cometd

I am trying to subscribe to a platform event using cometd. I have asserted that the event is getting published just fine but its subscribing that is an issue. I have placed console logs in the cometd....
user avatar
  • 211
5 votes
1 answer
2k views

Unable to subscribe to platform event using emp api

I am trying to subscribe to my platform event using the empapi feature. This feature was added in v44. I am following the example of the documentation page: https://developer.salesforce.com/docs/...
user avatar
  • 211
4 votes
0 answers
789 views

Using cometD in visualforce page

I am trying to use CometD with my platform events. I've added a basic use case for the time being for clarity: * I have a platformevent and a trigger. Whenever a client (custom object) gets edited, a ...
user avatar
  • 211
3 votes
1 answer
1k views

Subscribe to multiple channels using CometD

I'm trying to subscribe to multiple channels with CometD. I'm using the CometD static resource and syntax as per the Trailhead project: https://trailhead.salesforce.com/projects/workshop-platform-...
user avatar
2 votes
0 answers
145 views

Problem encountered while setting cometdReplayExtension

Good morning my friends, I'm having a problem trying to set up the dp cometd extension so that a ligthining component can process published events before its subscription. Below is my component, ...
user avatar
  • 21
1 vote
1 answer
144 views

Initialise streaming client on button click, rather than init

I am using Mr Fawcett's the famous streaming component (https://github.com/afawcett/streamingcomponent) with his another great wrapper for deploying Custom Metadata Types (https://github.com/afawcett/...
user avatar
  • 4,528
3 votes
1 answer
2k views

Platform Event for Guest Community User?

Can platform events be used for the unauthenticated guest user for communities? Looking to have a public-facing page that displays live statuses without requiring a log in. Streaming API appears to ...
user avatar
  • 2,564
2 votes
1 answer
1k views

How to publish Platform Event from aiosfstream python library?

I'm trying to consume/publish Platform Events using aiosfstream python library. There is a publish() function but I always get an error response: aiocometd.exceptions.ServerError: ('Publish request ...
user avatar
6 votes
2 answers
526 views

Cometd not working in summer 18

We have been using cometd with pushTopic. But we facing an issue an issue in summer 18 org that handshake with cometd is failing in lightning component. if we use lightning component directly in ...
user avatar
  • 3,311
0 votes
1 answer
325 views

Do I need to re initialize longpolling client with new access token on every connection session timeout?

Sample code how I'm initializing LongPollingTransport to create Bayeux client for subscribing pushtopic , LongPollingTransport transport = new LongPollingTransport(options, httpClient) {...
user avatar
1 vote
1 answer
635 views

Streaming API in Lightning Component getCallback error

I'm making a StreamingAPIListener Lightning component, built on this code from @Eric. (Thanks Eric.) The component loads up cometd from static resources, then runs doInit, which calls setupPushTopic, ...
user avatar
2 votes
1 answer
348 views

CometD / Streaming API: Firing an event inside of PushTopic's action throws a TypeError exception in Lightning Component

Let's consider a Lightning component with a single button and which uses a CometD / Streaming API to handle some server actions. A button click calls a server-side controller's action which inserts a ...
user avatar
2 votes
0 answers
147 views

Salesforce Java Streaming Client filtered subscription

I am subscribing to a push topic from a Salesforce Streaming java client that uses the cometd and bayeux libraries. I found this page which says that filtered subscriptions are supported in streaming ...
user avatar
9 votes
2 answers
4k views

CometD Issues when subscribing to Platform Events

I am using the notification Console Component described in this trailhead: Subscribe to Platform Events Trailhead I am able to get it working, and the majority of the time I have no issues. However, ...
user avatar
  • 1,345
0 votes
1 answer
3k views

"Cannot add property context, object is not extensible" error during CometD handshake in Lightning Component

I'm trying to set up a Lightning component to listen for Platform Events and the above error occurs while CometD is handshaking. What's interesting is I've tried the code in a Dev org and did not run ...
user avatar
0 votes
1 answer
476 views

Does Authorization using a OAuth access token work for CometD?

I keep getting a 401 response from the handshake end point https://na73.lightning.force.com/cometd/39.0/handshake after making a post request with the following header setting Authorization:Bearer ...
user avatar
  • 315
0 votes
1 answer
1k views

Subscribe Salesforce without using EMP Connector

I am writing a java application where a change in Salesforce Account should hit my java application through Streaming API.I gone through various articles and I found it can be achieved through Emp ...
user avatar
0 votes
1 answer
208 views

Need some more information on Salesforce Streaming API

While exploring Streaming API, found the API documentation and have gone through that. To integrate this the documentation mentions that Bayeux client is needed, for which CometD API is suggested. I ...
user avatar
5 votes
3 answers
4k views

Lightning components, CometD - Refused to connect to ... because it violates the following Content Security Policy directive

I am trying to build a Lightning component by an example from Salesforce Developers Youtube channel, here is original video: https://youtu.be/G931jWBnxHU?t=42m26s So author encaplulated code for ...
user avatar
  • 2,643