You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pulsar: add flag to enable transactions and set configuration (#5479)
* Add `withTransactions()` method to enable transactions on Pulsar container
* Set default version to latest released (2.10.0)
* New docker command that enables the user to easily change configuration parameters
* Added new tests to cover new methods
* Improved the documentation with simple usage and new methods
Copy file name to clipboardExpand all lines: docs/modules/pulsar.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,51 @@
1
1
# Apache Pulsar Module
2
2
3
+
Testcontainers can be used to automatically create [Apache Pulsar](https://pulsar.apache.org) containers without external services.
4
+
5
+
It's based on the official Apache Pulsar docker image, it is recommended to read the [official guide](https://pulsar.apache.org/docs/next/getting-started-docker/).
6
+
7
+
## Example
8
+
9
+
Create a `PulsarContainer` to use it in your tests:
10
+
11
+
<!--codeinclude-->
12
+
[Create a Pulsar container](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithVersion
13
+
<!--/codeinclude-->
14
+
15
+
Then you can retrieve the broker and the admin url:
16
+
17
+
<!--codeinclude-->
18
+
[Get broker and admin urls](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:coordinates
19
+
<!--/codeinclude-->
20
+
21
+
## Options
22
+
23
+
### Configuration
24
+
If you need to set Pulsar configuration variables you can use the native APIs and set each variable with `PULSAR_PREFIX_` as prefix.
25
+
26
+
For example, if you want to enable `brokerDeduplicationEnabled`:
If you need to test Pulsar IO framework you can enable the Pulsar Functions Worker:
35
+
36
+
<!--codeinclude-->
37
+
[Create a Pulsar container with functions worker](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithFunctionsWorker
38
+
<!--/codeinclude-->
39
+
40
+
### Pulsar Transactions
41
+
42
+
If you need to test Pulsar Transactions you can enable the transactions feature:
43
+
44
+
<!--codeinclude-->
45
+
[Create a Pulsar container with transactions](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithTransactions
46
+
<!--/codeinclude-->
47
+
48
+
3
49
## Adding this module to your project dependencies
4
50
5
51
Add the following dependency to your `pom.xml`/`build.gradle` file:
* See <a href="https://github.com/apache/pulsar/blob/master/pulsar-common/src/main/java/org/apache/pulsar/common/naming/SystemTopicNames.java">SystemTopicNames</a>.
0 commit comments