How to clear/delete published Platform event from EventBus after sometime?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty{ margin-bottom:0;
}
up vote
2
down vote
favorite
I'm publishing Platform Events using APEX Code
EventBus.publish
method and consuming the events in backend Java app using EventListener.
Problem
All the published events remains in EventBus and whenever my consumer Java app restarts, listener is receiving all the previously published events (in the past 24 hrs?, not sure about the timing though).
Is there any way to clear the events published to EventBus after some set interval? I've gone through the Platform Events documentation and couldn't find any help to tackle this problem.
Any pointer would be helpful
apex subscriber platform-event publisher
New contributor
add a comment |
up vote
2
down vote
favorite
I'm publishing Platform Events using APEX Code
EventBus.publish
method and consuming the events in backend Java app using EventListener.
Problem
All the published events remains in EventBus and whenever my consumer Java app restarts, listener is receiving all the previously published events (in the past 24 hrs?, not sure about the timing though).
Is there any way to clear the events published to EventBus after some set interval? I've gone through the Platform Events documentation and couldn't find any help to tackle this problem.
Any pointer would be helpful
apex subscriber platform-event publisher
New contributor
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm publishing Platform Events using APEX Code
EventBus.publish
method and consuming the events in backend Java app using EventListener.
Problem
All the published events remains in EventBus and whenever my consumer Java app restarts, listener is receiving all the previously published events (in the past 24 hrs?, not sure about the timing though).
Is there any way to clear the events published to EventBus after some set interval? I've gone through the Platform Events documentation and couldn't find any help to tackle this problem.
Any pointer would be helpful
apex subscriber platform-event publisher
New contributor
I'm publishing Platform Events using APEX Code
EventBus.publish
method and consuming the events in backend Java app using EventListener.
Problem
All the published events remains in EventBus and whenever my consumer Java app restarts, listener is receiving all the previously published events (in the past 24 hrs?, not sure about the timing though).
Is there any way to clear the events published to EventBus after some set interval? I've gone through the Platform Events documentation and couldn't find any help to tackle this problem.
Any pointer would be helpful
apex subscriber platform-event publisher
apex subscriber platform-event publisher
New contributor
New contributor
New contributor
asked 2 days ago
jusermar10
1133
1133
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
This is a feature called Event Durability. It is expected that the client retains the last replayId
it has seen, and pass this in to the streaming handshake to resume where they left off. There's no way to clear this early and yet provide durability. The events do drop off after 24 hours. You will need to modify your code to remember the last replayId
.
Got it! Thanks for pointing me in the right direction to trackreplayId
. Will play around.
– jusermar10
2 days ago
add a comment |
up vote
1
down vote
You cannot delete Platform Event records. This is mentioned in the documentation:
Unlike custom objects, you can’t update or delete event records.
The only way you can delete event records is by deleting its definition altogether:
When you delete a platform event definition, it’s permanently deleted.
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
This is a feature called Event Durability. It is expected that the client retains the last replayId
it has seen, and pass this in to the streaming handshake to resume where they left off. There's no way to clear this early and yet provide durability. The events do drop off after 24 hours. You will need to modify your code to remember the last replayId
.
Got it! Thanks for pointing me in the right direction to trackreplayId
. Will play around.
– jusermar10
2 days ago
add a comment |
up vote
4
down vote
accepted
This is a feature called Event Durability. It is expected that the client retains the last replayId
it has seen, and pass this in to the streaming handshake to resume where they left off. There's no way to clear this early and yet provide durability. The events do drop off after 24 hours. You will need to modify your code to remember the last replayId
.
Got it! Thanks for pointing me in the right direction to trackreplayId
. Will play around.
– jusermar10
2 days ago
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
This is a feature called Event Durability. It is expected that the client retains the last replayId
it has seen, and pass this in to the streaming handshake to resume where they left off. There's no way to clear this early and yet provide durability. The events do drop off after 24 hours. You will need to modify your code to remember the last replayId
.
This is a feature called Event Durability. It is expected that the client retains the last replayId
it has seen, and pass this in to the streaming handshake to resume where they left off. There's no way to clear this early and yet provide durability. The events do drop off after 24 hours. You will need to modify your code to remember the last replayId
.
answered 2 days ago
sfdcfox
239k10182401
239k10182401
Got it! Thanks for pointing me in the right direction to trackreplayId
. Will play around.
– jusermar10
2 days ago
add a comment |
Got it! Thanks for pointing me in the right direction to trackreplayId
. Will play around.
– jusermar10
2 days ago
Got it! Thanks for pointing me in the right direction to track
replayId
. Will play around.– jusermar10
2 days ago
Got it! Thanks for pointing me in the right direction to track
replayId
. Will play around.– jusermar10
2 days ago
add a comment |
up vote
1
down vote
You cannot delete Platform Event records. This is mentioned in the documentation:
Unlike custom objects, you can’t update or delete event records.
The only way you can delete event records is by deleting its definition altogether:
When you delete a platform event definition, it’s permanently deleted.
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
add a comment |
up vote
1
down vote
You cannot delete Platform Event records. This is mentioned in the documentation:
Unlike custom objects, you can’t update or delete event records.
The only way you can delete event records is by deleting its definition altogether:
When you delete a platform event definition, it’s permanently deleted.
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
add a comment |
up vote
1
down vote
up vote
1
down vote
You cannot delete Platform Event records. This is mentioned in the documentation:
Unlike custom objects, you can’t update or delete event records.
The only way you can delete event records is by deleting its definition altogether:
When you delete a platform event definition, it’s permanently deleted.
You cannot delete Platform Event records. This is mentioned in the documentation:
Unlike custom objects, you can’t update or delete event records.
The only way you can delete event records is by deleting its definition altogether:
When you delete a platform event definition, it’s permanently deleted.
edited 2 days ago
answered 2 days ago
Jayant Das
10.2k2522
10.2k2522
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
add a comment |
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
+1 lol you beat me by 6 seconds!
– codeyinthecloud
2 days ago
add a comment |
jusermar10 is a new contributor. Be nice, and check out our Code of Conduct.
jusermar10 is a new contributor. Be nice, and check out our Code of Conduct.
jusermar10 is a new contributor. Be nice, and check out our Code of Conduct.
jusermar10 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f239645%2fhow-to-clear-delete-published-platform-event-from-eventbus-after-sometime%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown