This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.pulsar.client.api.*; | |
| public class PulsarConsumer { | |
| public static void main(String[] args) throws Exception { | |
| PulsarClient client = PulsarClient.builder() | |
| .serviceUrl("pulsar://localhost:6650") | |
| .build(); | |
| Consumer<String> consumer = client.newConsumer(Schema.STRING) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import $ivy.{ | |
| `org.typelevel::cats-effect:2.1.3` | |
| } | |
| import cats.effect.{ContextShift, IO, Timer} | |
| import cats.implicits._ | |
| import scala.concurrent.CancellationException | |
| import scala.concurrent.ExecutionContext.global |