sammoh94 edited a comment on issue #99:
URL: 
https://github.com/apache/pulsar-client-node/issues/99#issuecomment-651251987


   Producer or client? I create the producer as follows: 
   
   ```
   this.producer = await client.createProducer({
           topic: generateTopicName(config.pulsar.tenant, 
config.pulsar.namespace),
           producerName: 'my_topic_name',
           sendTimeoutMs: 30000,
         });
   ```
   
   The client is created as follows:
   
   ```
     const toAny = (pulsar as unknown) as any;
     const auth = new toAny.AuthenticationToken({ token: config.pulsar.token });
   
     return new pulsar.Client({
       ...PULSAR_DEFAULT_OPTS,
       serviceUrl: 
`pulsar+ssl://${config.pulsar.hostname}:${config.pulsar.port}`,
       authentication: auth,
     });
   }
   ```
   
   In the default ops, I am just setting the operation timeout seconds field:
   ```
   export const PULSAR_DEFAULT_OPTS = {
     operationTimeoutSeconds: 30,
   };
   ```


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to