Skip to content

Commit 5c7afd4

Browse files
authored
docs(readme): add info to code snippets (#173)
1 parent 259b8e5 commit 5c7afd4

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A [Coveo Push API](https://docs.coveo.com/en/12/api-reference/push-api) client l
99
The Coveo `push-api-client.java` package is stored on GitHub packages.
1010
You will need a personal access token (classic) with at least `read:packages` scope to install this dependency.
1111

12-
For details, see [Authenticating to GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-to-github-packages)
12+
For details, see [Authenticating to GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-to-github-packages).
1313

1414
## Installation
1515

@@ -29,7 +29,7 @@ You can install this GitHub Package with [Apache Maven](https://maven.apache.org
2929
</repository>
3030
```
3131

32-
1. Add your GitHub personal access token with read:packages permission to install packages from GitHub Packages.
32+
2. Add your GitHub personal access token with `read:packages` permission to install packages from GitHub Packages.
3333

3434
```xml
3535
<servers>
@@ -41,21 +41,25 @@ You can install this GitHub Package with [Apache Maven](https://maven.apache.org
4141
</servers>
4242
```
4343

44-
### Step 2: Add a Coveo dependency to project
44+
Replace `USERNAME` with your GitHub username and `TOKEN` with your personal access token.
4545

46-
Add a Coveo dependency to your Maven project by editing the `pom.xml` file.
46+
### Step 2: Add a Coveo Dependency to Your Project
47+
48+
Add a Coveo dependency to your Maven project by editing the `pom.xml` file:
4749

4850
```xml
4951
<dependency>
5052
<groupId>com.coveo</groupId>
5153
<artifactId>push-api-client.java</artifactId>
52-
<version>2.3.0</version>
54+
<version>2.6.1</version> <!-- Replace with the version of your choice or the latest version -->
5355
</dependency>
5456
```
5557

56-
### Step 3: Install the project files
58+
Replace `2.6.1` with the version of your choice or the latest version.
59+
60+
### Step 3: Install the Project Files
5761

58-
To install the updated project files, build the Maven project.
62+
To install the updated project files, build the Maven project:
5963

6064
```bash
6165
mvn install
@@ -89,10 +93,9 @@ public class PushOneDocument {
8993
}
9094
}
9195
}
92-
9396
```
9497

95-
### Exponential backoff retry configuration
98+
### Exponential Backoff Retry Configuration
9699

97100
By default, the SDK leverages an exponential backoff retry mechanism. Exponential backoff allows for the SDK to make multiple attempts to resolve throttled requests, increasing the amount of time to wait for each subsequent attempt. Outgoing requests will retry when a `429` status code is returned from the platform.
98101

@@ -110,7 +113,7 @@ The exponential backoff parameters are as follows:
110113

111114
Optional, will default to 2.
112115

113-
You may configure the exponential backoff that will be applied to all outgoing requests. To do so, specify use the `BackoffOptionsBuilder` class to create a `BackoffOptions` object when creating either a `PushService`, `PushSource`, or `StreamService` object:
116+
You may configure the exponential backoff that will be applied to all outgoing requests. To do so, use the `BackoffOptionsBuilder` class to create a `BackoffOptions` object when creating either a `PushService`, `PushSource`, or `StreamService` object:
114117

115118
```java
116119
PushSource pushSource = new PushSource("my_api_key", "my_org_id", new BackoffOptionsBuilder().withMaxRetries(5).withRetryAfter(10000).build());
@@ -127,9 +130,7 @@ By default, requests will retry a maximum of 10 times, waiting 5 seconds after t
127130
If you want to push multiple documents to your Coveo organization and use a service for that (e.g. `PushService`, `StreamService`), you may find it useful to configure a **logger** to catch error and warning messages.
128131

129132
1. Go to your project's root folder.
130-
131-
1. Update the Apache Log4j2 configuration by editing the `log4j2.xml` file.
132-
The following example will print the log execution to the console.
133+
2. Update the Apache Log4j2 configuration by editing the `log4j2.xml` file. The following example will print the log execution to the console.
133134

134135
```xml
135136
<?xml version="1.0" encoding="UTF-8"?>
@@ -147,9 +148,9 @@ If you want to push multiple documents to your Coveo organization and use a serv
147148
</Configuration>
148149
```
149150

150-
For more details, see [Log4j2 configuration](https://logging.apache.org/log4j/2.x/manual/configuration.html).
151+
For more details, see [Log4j2 configuration](https://logging.apache.org/log4j/2.x/manual/configuration.html).
151152

152-
## Formatting the code before contributing
153+
## Formatting the Code Before Contributing
153154

154155
This project uses [Google Java Format](https://github.com/google/google-java-format), so make sure your code is properly formatted before opening a pull request.
155156

@@ -212,3 +213,7 @@ git push --tags
212213
### Step 3 - Manually Create a Release
213214

214215
Lastly, manually create a release on the [GitHub repository](https://github.com/coveo/push-api-client.java/releases). This action will trigger the package deploy workflow action.
216+
217+
---
218+
219+
Happy coding!

0 commit comments

Comments
 (0)