File tree Expand file tree Collapse file tree
sentry-samples/sentry-samples-console/src/main/java/io/sentry/samples/console/kafka Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323public final class KafkaShowcase {
2424
25+ public static final String TOPIC = "sentry-topic-console-sample" ;
26+
2527 private KafkaShowcase () {}
2628
2729 public static void demonstrate (final String bootstrapServers ) {
28- final String topic = "sentry-topic-console-sample" ;
2930 final CountDownLatch consumedLatch = new CountDownLatch (1 );
30- final Thread consumerThread = startKafkaConsumerThread (topic , bootstrapServers , consumedLatch );
31+ final Thread consumerThread = startKafkaConsumerThread (TOPIC , bootstrapServers , consumedLatch );
3132
3233 final Properties producerProperties = new Properties ();
3334 producerProperties .put (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , bootstrapServers );
@@ -45,7 +46,7 @@ public static void demonstrate(final String bootstrapServers) {
4546 try (ISentryLifecycleToken ignored = transaction .makeCurrent ()) {
4647 try (KafkaProducer <String , String > producer = new KafkaProducer <>(producerProperties )) {
4748 Thread .sleep (500 );
48- producer .send (new ProducerRecord <>(topic , "sentry-kafka sample message" )).get ();
49+ producer .send (new ProducerRecord <>(TOPIC , "sentry-kafka sample message" )).get ();
4950 } catch (InterruptedException e ) {
5051 Thread .currentThread ().interrupt ();
5152 } catch (Exception ignoredException ) {
You can’t perform that action at this time.
0 commit comments