Skip to content

Commit 43bf1e8

Browse files
committed
doc: simplified default setup
1 parent 06d2973 commit 43bf1e8

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

README.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ Here's an example that will get you started quickly. It listens to a single acco
110110
const client = new PubSubApiClient();
111111
await client.connect();
112112

113-
// Subscribe to a single incoming account change event
113+
// Subscribe to account change events
114114
const eventEmitter = await client.subscribe(
115-
'/data/AccountChangeEvent',
116-
1
115+
'/data/AccountChangeEvent'
117116
);
118117

119118
// Handle incoming events
@@ -127,15 +126,6 @@ Here's an example that will get you started quickly. It listens to a single acco
127126
);
128127
console.log(JSON.stringify(event, null, 2));
129128
});
130-
131-
// Handle last requested event
132-
eventEmitter.on('lastevent', () => {
133-
console.log(
134-
`Reached last requested event on channel ${eventEmitter.getTopicName()}.`
135-
);
136-
// At this point the gRPC client will close automatically
137-
// unless you re-subscribe to request more events (default Pub/Sub API behavior)
138-
});
139129
} catch (error) {
140130
console.error(error);
141131
}
@@ -152,7 +142,7 @@ Here's an example that will get you started quickly. It listens to a single acco
152142
Connected to Salesforce org https://pozil-dev-ed.my.salesforce.com as grpc@pozil.com
153143
Connected to Pub/Sub API endpoint api.pubsub.salesforce.com:7443
154144
Topic schema loaded: /data/AccountChangeEvent
155-
Subscribe request sent for 1 events from /data/AccountChangeEvent...
145+
Subscribe request sent for 100 events from /data/AccountChangeEvent...
156146
```
157147
158148
At this point the script will be on hold and will wait for events.
@@ -163,7 +153,7 @@ Here's an example that will get you started quickly. It listens to a single acco
163153
164154
```
165155
Received 1 events, latest replay ID: 18098167
166-
Handling Account change event with ID 18098167 on channel /data/AccountChangeEvent (1/1 events received so far)
156+
Handling Account change event with ID 18098167 on channel /data/AccountChangeEvent (1/100 events received so far)
167157
{
168158
"replayId": 18098167,
169159
"payload": {
@@ -241,14 +231,6 @@ Here's an example that will get you started quickly. It listens to a single acco
241231

242232
Use the values from `ChangeEventHeader.nulledFields`, `ChangeEventHeader.diffFields` and `ChangeEventHeader.changedFields` to identify actual value changes.
243233

244-
After receiving the number of requested events, the script will terminate with these messages:
245-
246-
```
247-
Reached last requested event on channel /data/AccountChangeEvent
248-
gRPC stream status: {"code":0,"details":"","metadata":{}}
249-
gRPC stream ended
250-
```
251-
252234
## Other Examples
253235

254236
### Publish a platform event

0 commit comments

Comments
 (0)