Skip to content

Commit 1664a14

Browse files
committed
enable pulsar txn coordinator
1 parent 48bc016 commit 1664a14

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

instrumentation/pulsar/pulsar-2.8/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/AbstractPulsarClientTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ static void beforeAll() throws PulsarClientException {
8888
pulsar =
8989
new PulsarContainer(DEFAULT_IMAGE_NAME)
9090
.withEnv("PULSAR_MEM", "-Xmx128m")
91+
.withEnv("PULSAR_PREFIX_transactionCoordinatorEnabled", "true")
92+
.withEnv("PULSAR_PREFIX_transactionMetadataStoreProviderClassName", "org.apache.pulsar.transaction.coordinator.impl.InMemTransactionMetadataStoreProvider")
9193
.withLogConsumer(new Slf4jLogConsumer(logger))
9294
.withStartupTimeout(Duration.ofMinutes(2));
9395
pulsar.start();

instrumentation/pulsar/pulsar-2.8/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/pulsar/v2_8/PulsarClientTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,13 @@ void testConsumePartitionedTopicUsingBatchReceive() throws Exception {
677677
void testSendMessageWithTxn() throws Exception {
678678
String topic = "persistent://public/default/testSendMessageWithTxn";
679679
admin.topics().createNonPartitionedTopic(topic);
680-
producer = client.newProducer(Schema.STRING).topic(topic).enableBatching(false).create();
680+
producer = client.newProducer(Schema.STRING).topic(topic)
681+
.sendTimeout(0, TimeUnit.SECONDS).enableBatching(false).create();
681682
Transaction txn =
682683
client.newTransaction().withTransactionTimeout(5, TimeUnit.SECONDS).build().get();
684+
txn.commit();
683685

684686
testing.runWithSpan("parent1", () -> producer.newMessage(txn).value("test1").send());
685-
686687
testing.waitAndAssertTraces(
687688
trace ->
688689
trace.hasSpansSatisfyingExactly(

0 commit comments

Comments
 (0)