You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/16 07:11:40 UTC

[GitHub] [pulsar] shiv4289 opened a new issue #4283: flink job crashes when serializing auth in pulsar client

shiv4289 opened a new issue #4283: flink job crashes when serializing auth in pulsar client
URL: https://github.com/apache/pulsar/issues/4283
 
 
   **Describe the bug**
   pulsar flink connector now uses ClientConfigData to instantiate pulsar client. Pulsar client composes Authentication which can not be serialized. In an environment with Auth there is no way to set auth in pulsar client.
   
   **To Reproduce**
   The below code crashes on last line:
   
   >         ClientConfigurationData clientConfig = new ClientConfigurationData();
   >         clientConfig.setServiceUrl(PULSAR_BROKER_URL);
   >         clientConfig.setAuthPluginClassName(AuthenticationToken.class.getName());
   >         clientConfig.setAuthParams(ImmutableMap.of("token", PULSAR_AUTH_TOKEN));
   > 
   >         ConsumerConfigurationData consumerConfig = new ConsumerConfigurationData();
   >         consumerConfig.setSubscriptionInitialPosition(SubscriptionInitialPosition.Earliest);
   >         consumerConfig.setTopicNames(new HashSet<>(Arrays.asList(PULSAR_TOPIC)));
   >         consumerConfig.setSubscriptionName(PULSAR_SUBSCRIPTION_NAME);
   > 
   >         PulsarSourceBuilder pulsarSourceBuilder = PulsarSourceBuilder.builder(new SimpleStringSchema())
   >                 .pulsarAllClientConf(clientConfig)
   >                 .pulsarAllConsumerConf(consumerConfig);
   > 
   >         StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
   > 
   >         env.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime);
   > 
   >         SourceFunction src = pulsarSourceBuilder.build();
   >         DataStream dataStream = env.addSource(src).uid("testStream");
   
   **Expected behavior**
   Provide a way to set Auth for pulsar client from pulsar flink connector
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services