Questions tagged [cometd]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
183 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')&...
0
votes
0answers
54 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/...
1
vote
0answers
131 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 ...
0
votes
1answer
45 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 ...
4
votes
0answers
39 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 ...
0
votes
0answers
55 views

Emp Connector subscription "already subscribed to channel"

I'm trying to fix an error in a java program that uses the EMP connector. The program, as I understand it (it is not mine, and also I'm pretty new to programming) connects to salesforce, fetches data ...
2
votes
1answer
137 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 ...
0
votes
1answer
331 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'; ...
1
vote
1answer
246 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 ...
1
vote
0answers
146 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 ...
1
vote
0answers
261 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 ...
1
vote
1answer
17 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 ...
0
votes
0answers
43 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 ...
0
votes
0answers
37 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 ...
1
vote
2answers
852 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 ...
1
vote
0answers
280 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, ...
4
votes
1answer
4k 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 ...
5
votes
1answer
275 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. ...
2
votes
1answer
77 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 = ...
1
vote
1answer
149 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 ...
4
votes
1answer
1k 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 ...
0
votes
1answer
400 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', ...
2
votes
1answer
893 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 ...
1
vote
0answers
376 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 ...
2
votes
0answers
287 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 ...
1
vote
0answers
379 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 ...
6
votes
0answers
290 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 ...
1
vote
1answer
929 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 ...
1
vote
0answers
672 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 ...
1
vote
0answers
80 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 ...
11
votes
1answer
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....
5
votes
1answer
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/...
4
votes
0answers
723 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 ...
3
votes
1answer
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-...
2
votes
0answers
132 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, ...
1
vote
1answer
142 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/...
3
votes
1answer
1k 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 ...
2
votes
1answer
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 ...
6
votes
2answers
481 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 ...
0
votes
1answer
285 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) {...
1
vote
1answer
630 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, ...
2
votes
1answer
325 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 ...
2
votes
0answers
142 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 ...
9
votes
2answers
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, ...
0
votes
1answer
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 ...
0
votes
1answer
422 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 ...
0
votes
1answer
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 ...
0
votes
1answer
194 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 ...
4
votes
3answers
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 ...
2
votes
1answer
2k views

How to use latest cometd version in Salesforce StreamingAPI

Following the instructions here I was able to set up StreamingAPI in my org with cometd version 2.2.0. Salesforce are now advising that we upgrade to at least 3.0.9 so I've downloaded the latest ...