|
1 | 1 | [](https://github.com/rudderlabs/rudder-sdk-java/actions/workflows/build-and-quality-checks.yml) |
| 2 | +[](https://deepwiki.com/rudderlabs/rudder-sdk-java) |
2 | 3 |
|
3 | 4 | # What is RudderStack? |
4 | 5 |
|
5 | | -[RudderStack](https://rudderstack.com/) is a **customer data pipeline** tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse. |
| 6 | +[RudderStack](https://rudderstack.com/) is a **customer data pipeline** tool for collecting, routing and processing data from |
| 7 | +your websites, apps, cloud tools, and data warehouse. |
6 | 8 |
|
7 | 9 | ## RudderStack's Java SDK |
8 | 10 |
|
9 | | -RudderStack’s Java SDK allows you to track your customer event data from your Java code. Once enabled, the event requests hit the RudderStack servers. RudderStack then routes the events to the specified destination platforms as configured by you. |
| 11 | +RudderStack’s Java SDK allows you to track your customer event data from your Java code. Once enabled, the event requests hit |
| 12 | +the RudderStack servers. RudderStack then routes the events to the specified destination platforms as configured by you. |
10 | 13 |
|
11 | | -For detailed documentation on the Java SDK, click [here](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-java-sdk/). |
| 14 | +For detailed documentation on the Java SDK, |
| 15 | +click [here](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-java-sdk/). |
12 | 16 |
|
13 | 17 | ## Getting Started with the RudderStack Java SDK |
14 | 18 |
|
15 | 19 | *Add to `pom.xml`:* |
16 | 20 |
|
17 | 21 | ```xml |
| 22 | + |
18 | 23 | <dependency> |
19 | 24 | <groupId>com.rudderstack.sdk.java.analytics</groupId> |
20 | 25 | <artifactId>analytics</artifactId> |
21 | | - <version>3.0.0</version> |
| 26 | + <version>x.y.z</version> |
22 | 27 | </dependency> |
23 | 28 |
|
24 | 29 | ``` |
25 | 30 |
|
26 | 31 | *or if you're using Gradle:* |
27 | 32 |
|
28 | 33 | ```bash |
29 | | -implementation 'com.rudderstack.sdk.java.analytics:analytics:3.0.0' |
| 34 | +implementation 'com.rudderstack.sdk.java.analytics:analytics:x.y.z' |
30 | 35 | ``` |
31 | 36 |
|
32 | 37 | ## Initializing ```RudderClient``` |
33 | 38 |
|
34 | 39 | ```java |
35 | | -RudderAnalytics analytics = RudderAnalytics |
36 | | - .builder("<WRITE_KEY>") |
37 | | - .setDataPlaneUrl("<DATA_PLANE_URL>") |
38 | | - .build(); |
| 40 | +RudderAnalytics analytics=RudderAnalytics |
| 41 | + .builder("<WRITE_KEY>") |
| 42 | + .setDataPlaneUrl("<DATA_PLANE_URL>") |
| 43 | + .build(); |
39 | 44 | ``` |
40 | 45 |
|
41 | 46 | ## Sending events |
42 | 47 |
|
43 | 48 | ```java |
44 | | -Map<String, Object> map = new HashMap<>(); |
45 | | -map.put("name", "John Marshal"); |
46 | | -map.put("email", "john@example.com"); |
47 | | -analytics.enqueue(IdentifyMessage.builder() |
| 49 | +Map<String, Object> map=new HashMap<>(); |
| 50 | + map.put("name","John Marshal"); |
| 51 | + map.put("email","john@example.com"); |
| 52 | + analytics.enqueue(IdentifyMessage.builder() |
48 | 53 | .userId("6754ds7d9") |
49 | 54 | .traits(map) |
50 | | -); |
| 55 | + ); |
51 | 56 | ``` |
52 | 57 |
|
53 | | -For more information on the different types of events supported by the Java SDK, refer to our [docs](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-java-sdk/). |
| 58 | +For more information on the different types of events supported by the Java SDK, refer to |
| 59 | +our [docs](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-java-sdk/). |
54 | 60 |
|
55 | 61 | ## Contact Us |
56 | 62 |
|
57 | | -If you come across any issues while configuring or using this SDK, feel free to start a conversation on our [Slack](https://resources.rudderstack.com/join-rudderstack-slack) channel. We will be happy to help you. |
| 63 | +If you come across any issues while configuring or using this SDK, feel free to start a conversation on |
| 64 | +our [Slack](https://resources.rudderstack.com/join-rudderstack-slack) channel. We will be happy to help you. |
0 commit comments