[GitHub] [pulsar] yangwenjie88 opened a new issue #6829: pulsar-client MultiTopicsConsumerImpl frequently fullgc

2020-04-26 Thread GitBox


yangwenjie88 opened a new issue #6829:
URL: https://github.com/apache/pulsar/issues/6829


   300 partitions topic 1200W/s,  pulsar-client 2.5.1
   
   
   failover SubscriptionType, When using 150 2core 4G vm, fullgc frequently 
appears, the connection has been reconnected, and the consumption cannot be 
achieved at all.
   Some parameter configuration:
receiverQueueSize = 1000
   maxTotalReceiverQueueSizeAcrossPartitions = 6
   Instead of using 20 16core 32G VMs when consuming, the memory usage is 
relatively high at startup, and there will be reconnection, which can be 
consumed after a while, but the speed is only 3000ms / s per partition. The 
performance is far from enough, 
   when the receiverQueueSize=3000, fullgc will appear
   When the specified partition is used for single consumption, the performance 
is normal. MultiTopicsConsumerImpl Multi-partition consumption is estimated to 
have performance problems



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




[GitHub] [pulsar] BewareMyPower commented on pull request #6827: [Issue 6822][C++] Fix segmentation fault if handleSendTimeout() is called after closeAsync()

2020-04-26 Thread GitBox


BewareMyPower commented on pull request #6827:
URL: https://github.com/apache/pulsar/pull/6827#issuecomment-619703665


   /pulsarbot run-failure-checks



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




[GitHub] [pulsar] KannarFr commented on pull request #6799: optional auth method name header in http authentication

2020-04-26 Thread GitBox


KannarFr commented on pull request #6799:
URL: https://github.com/apache/pulsar/pull/6799#issuecomment-619683210


   rebased



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




[GitHub] [pulsar] KannarFr commented on pull request #6428: [Issue 5720][authorization provider] Add granularity

2020-04-26 Thread GitBox


KannarFr commented on pull request #6428:
URL: https://github.com/apache/pulsar/pull/6428#issuecomment-619683066


   rebased.



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




[GitHub] [pulsar-client-go] solarhell commented on issue #233: Reader cannot read first message produced to new topic

2020-04-26 Thread GitBox


solarhell commented on issue #233:
URL: 
https://github.com/apache/pulsar-client-go/issues/233#issuecomment-619676100


   you need to config `SubscriptionInitialPosition`
   just like kafka consumer's auto.offset.reset.



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




[GitHub] [pulsar-client-go] hrsakai commented on issue #217: Support ack timeout

2020-04-26 Thread GitBox


hrsakai commented on issue #217:
URL: 
https://github.com/apache/pulsar-client-go/issues/217#issuecomment-619676114


   We will consider using nack instead of ack timeout.



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




[GitHub] [pulsar-client-go] solarhell edited a comment on issue #233: Reader cannot read first message produced to new topic

2020-04-26 Thread GitBox


solarhell edited a comment on issue #233:
URL: 
https://github.com/apache/pulsar-client-go/issues/233#issuecomment-619676100


   you need to config `SubscriptionInitialPosition`
   just like kafka consumer's `auto.offset.reset`.



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




[GitHub] [pulsar-client-go] hrsakai commented on issue #217: Support ack timeout

2020-04-26 Thread GitBox


hrsakai commented on issue #217:
URL: 
https://github.com/apache/pulsar-client-go/issues/217#issuecomment-619674232


   @wolfstudy 
   Thank you for your explanation.
   It makes sense to me.



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




[GitHub] [pulsar] gaoran10 commented on pull request #6379: [Issue 4803][client] return null if the message value/data is not set by producer

2020-04-26 Thread GitBox


gaoran10 commented on pull request #6379:
URL: https://github.com/apache/pulsar/pull/6379#issuecomment-619673447


   /pulsarbot run-failure-checks



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




[GitHub] [pulsar] archfish commented on issue #5668: bookie server's log error: Failed to restore rocksdb 000000000000000000/000000000000000001/000000000000000000

2020-04-26 Thread GitBox


archfish commented on issue #5668:
URL: https://github.com/apache/pulsar/issues/5668#issuecomment-619671840


   Pulsar 2.5.0 still have this issue,running in standalone mode. Now i start 
pulsar with -nss parameter hope normal.



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




[GitHub] [pulsar] sijie commented on issue #6828: Nodejs- Pulsar-Client NPM issues

2020-04-26 Thread GitBox


sijie commented on issue #6828:
URL: https://github.com/apache/pulsar/issues/6828#issuecomment-619665515


   @nkurihar are you and your team able to help with this issue?



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




[GitHub] [pulsar-client-go] sijie commented on issue #235: Is this a duplicated of apache/pulsar/pulsar-go-client?

2020-04-26 Thread GitBox


sijie commented on issue #235:
URL: 
https://github.com/apache/pulsar-client-go/issues/235#issuecomment-619665132


   @JoseFMP I have answered your question in apache/pulsar#6823. Close this 
issue.



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




[GitHub] [pulsar] sijie commented on issue #6823: Duplicated repository?

2020-04-26 Thread GitBox


sijie commented on issue #6823:
URL: https://github.com/apache/pulsar/issues/6823#issuecomment-619664719


   @JoseFMP - 
   
   https://github.com/apache/pulsar/tree/master/pulsar-client-go is the c-go 
client that is built using the pulsar-client-cpp library.
   
https://github.com/apache/pulsar-client-go is the native go client. 
   
   The c-go client will be deprecated in future releases. If you just start 
with Pulsar, please use the native go client.
   



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




[GitHub] [pulsar] sijie commented on issue #6821: Pulsar+SSL Java client issue (TLS encryption) via Nginx

2020-04-26 Thread GitBox


sijie commented on issue #6821:
URL: https://github.com/apache/pulsar/issues/6821#issuecomment-619664277


   @surendra-k how did you setup Nginx? Which component did Nginx point to, 
broker or proxy?



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




[GitHub] [pulsar] sijie commented on issue #6820: Persistent topic put request doesn't return 409 error if topic exists

2020-04-26 Thread GitBox


sijie commented on issue #6820:
URL: https://github.com/apache/pulsar/issues/6820#issuecomment-619663403


   @nitinmuteja did you run pulsar-admin to check if the issue exists in the 
pulsar-admin tool? I am wondering if you have sent the right command to pulsar 
admin RESTful service.



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




[GitHub] [pulsar] sijie commented on issue #6813: Function gets stuck in the context.getState() method

2020-04-26 Thread GitBox


sijie commented on issue #6813:
URL: https://github.com/apache/pulsar/issues/6813#issuecomment-619662234


   @javard did you enable bookkeeper state storage?



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




[GitHub] [pulsar] BewareMyPower commented on pull request #6827: [Issue 6822][C++] Fix segmentation fault if handleSendTimeout() is called after closeAsync()

2020-04-26 Thread GitBox


BewareMyPower commented on pull request #6827:
URL: https://github.com/apache/pulsar/pull/6827#issuecomment-619660511


   /pulsarbot run-failure-checks



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




[pulsar-translation] branch master updated: Update schedule_zh-CN.md (#28)

2020-04-26 Thread liuyu
This is an automated email from the ASF dual-hosted git repository.

liuyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-translation.git


The following commit(s) were added to refs/heads/master by this push:
 new df611f4  Update schedule_zh-CN.md (#28)
df611f4 is described below

commit df611f459f263c62128e0189d986586343cf62dc
Author: sijia-w <53718687+siji...@users.noreply.github.com>
AuthorDate: Mon Apr 27 02:29:20 2020 +0200

Update schedule_zh-CN.md (#28)
---
 schedule_zh-CN.md | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/schedule_zh-CN.md b/schedule_zh-CN.md
index e55f5bc..79eb112 100644
--- a/schedule_zh-CN.md
+++ b/schedule_zh-CN.md
@@ -49,23 +49,23 @@ schema-get-started | SylviaBABY | sijia-w | Approved
 schema-understand | SylviaBABY | sijia-w | Approved
 schema-evolution-compatibility | SylviaBABY | sijia-w | Approved
 schema-manage | SylviaBABY | sijia-w | Approved
-functions-overview | SylviaBABY | | In Progress
-functions-worker | SylviaBABY | | In Progress
+functions-overview | SylviaBABY | sijia-w | Approved
+functions-worker | sijia-w | sijia-w | Approved
 functions-runtime | SylviaBABY | | In Progress
-functions-develop | SylviaBABY | | In Progress
+functions-develop | sijia-w | sijia-w | Approved
 functions-debug | SylviaBABY | sijia-w | Approved
-functions-deploy | SylviaBABY | | In Progress
+functions-deploy | sijia-w | sijia-w | Approved
 functions-cli | SylviaBABY | sijia-w | Approved
 io-overview | | | To Do
 io-quickstart (Correspond 'Get started') | | | To Do
 io-use | | | To Do
 io-debug | | | To Do
-io-connectors | SylviaBABY | | In Progress
-io-cdc | SylviaBABY | | In Progress
-io-develop | | | To Do
+io-connectors | SylviaBABY | sijia-w | Approved
+io-cdc | SylviaBABY | sijia-w | Approved
+io-develop | sijia-w | | Translated
 io-cli | | | To Do
 io-aerospike-sink | | | To Do
-io-canal-source | | | To Do
+io-canal-source | sijia-w | | Translated
 io-cassandra-sink | | | To Do
 io-cdc-canal | | | Deprecated
 io-cdc-debezium | | | To Do



[GitHub] [pulsar] TolulopeAwode opened a new issue #6828: Nodejs- Pulsar-Client NPM issues

2020-04-26 Thread GitBox


TolulopeAwode opened a new issue #6828:
URL: https://github.com/apache/pulsar/issues/6828


   **Describe the bug**
   Attempt to install pulsar-client from npm, was not successful: _node-pre-gyp 
WARN Tried to download(404): 
https://pulsar.apache.org/docs/en/client-libraries-cpp/libpulsar-v1.1.0-node-v64-linux-x64.tar.gz_
   node-pre-gyp WARN Pre-built binaries not found for pulsar-client@1.1.0 and 
node@10.20.1 (node-v64 ABI, glibc) (falling back to source compile with 
node-gyp)
   
   **To Reproduce**
   Steps to reproduce the behavior:
   ```sh
   npm install pulsar-client
   ```
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   **Screenshots**
   
![image](https://user-images.githubusercontent.com/54535768/80318632-5fb1f900-8803-11ea-81b0-70c8ad883fbc.png)
   
   
   
   **Desktop (please complete the following information):**
- OS: [e.g. iOS]
   
   **Additional context**
   Add any other context about the problem here.
   



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




[GitHub] [pulsar-client-go] frankjkelly commented on issue #233: Reader cannot read first message produced to new topic

2020-04-26 Thread GitBox


frankjkelly commented on issue #233:
URL: 
https://github.com/apache/pulsar-client-go/issues/233#issuecomment-619598535


   Ah thanks so much for clarifying my misunderstanding - that makes sense. 
Closing . . . .



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




[GitHub] [pulsar] BewareMyPower removed a comment on pull request #6827: [Issue 6822][C++] Fix segmentation fault if handleSendTimeout() is called after closeAsync()

2020-04-26 Thread GitBox


BewareMyPower removed a comment on pull request #6827:
URL: https://github.com/apache/pulsar/pull/6827#issuecomment-61959


   /pulsarbot run-failure-checks



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




[GitHub] [pulsar] BewareMyPower commented on pull request #6827: [Issue 6822][C++] Fix segmentation fault if handleSendTimeout() is called after closeAsync()

2020-04-26 Thread GitBox


BewareMyPower commented on pull request #6827:
URL: https://github.com/apache/pulsar/pull/6827#issuecomment-61959


   /pulsarbot run-failure-checks



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




[GitHub] [pulsar] BewareMyPower commented on pull request #6827: [Issue 6822][C++] Fix segmentation fault if handleSendTimeout() is called after closeAsync()

2020-04-26 Thread GitBox


BewareMyPower commented on pull request #6827:
URL: https://github.com/apache/pulsar/pull/6827#issuecomment-619583348


   /pulsarbot run-failure-checks



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




[GitHub] [pulsar] BewareMyPower opened a new pull request #6827: [Issue 6822][C++] Fix segmentation fault if handleSendTimeout() is called after closeAsync()

2020-04-26 Thread GitBox


BewareMyPower opened a new pull request #6827:
URL: https://github.com/apache/pulsar/pull/6827


   Fixes #6822 
   
   ### Motivation
   
   Whan I reduced the send timeout to reproduce `ResultTimeout` error, I found 
that the program may cause segmentation fault after closed accidentally. Then I 
found  `ProducerImpl::handleSendTimeout()` doesn't check the state or other 
fields of `ProducerImpl`, which may cause that a null `sendTimer_` calls its 
methods.
   
   ### Modifications
   
   - Acquire `mutex_` and check if the `state_` is `Ready` before handling the 
send timer callback;
   - Devide `failPendingMessages()` into two parts which are 
`getPendingCallbacksWhenFailedWithLock()` and `PendingCallbacks::complete()`.
   
   - The 1st part needs to acquire `mutex_` to access class members safely. 
In addition, we already hold `mutex_` before `failPendingMessages()`, so we 
need a method to get necessary callbacks without the lock.
   - The 2nd part doesn't and shouldn't acquire `mutex_`, because we don't 
know how long user provided callbacks may cost. If lock this part, `mutex_` may 
be hold for a long time.
   - Define a new struct contains a 
`BatchMessageContainer::MessageContainerListPtr` field, because nested classes 
can't be forward declared.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change can be verified as follows:
   - Try to reproduce the error as #6822;
   - From the log you can see no callbacks called after `closeAsync()` and the 
program exited normally.



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




[GitHub] [pulsar] zr-hebo commented on issue #6815: Geo repeated consumption

2020-04-26 Thread GitBox


zr-hebo commented on issue #6815:
URL: https://github.com/apache/pulsar/issues/6815#issuecomment-619551417


   set de-duplication solved this problem



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




[GitHub] [pulsar] BewareMyPower commented on issue #6822: Segmentation fault of C++ client when close a producer if there're pending expired messages

2020-04-26 Thread GitBox


BewareMyPower commented on issue #6822:
URL: https://github.com/apache/pulsar/issues/6822#issuecomment-619550446


   I've fixed this bug, a PR will be pushed.



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




[GitHub] [pulsar] yjshen opened a new pull request #6826: File connector should have type `source` in download page

2020-04-26 Thread GitBox


yjshen opened a new pull request #6826:
URL: https://github.com/apache/pulsar/pull/6826


   



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




[GitHub] [pulsar] liudezhi2098 opened a new pull request #6825: support async send msg return sequenceId when throw Exception

2020-04-26 Thread GitBox


liudezhi2098 opened a new pull request #6825:
URL: https://github.com/apache/pulsar/pull/6825


   Master Issue: #6824
   ## Motivation
   
   When sending messages asynchronously fails, an exception will be thrown, but 
it is not known which message is abnormal, and the user does not know which 
messages need to be retried。
   
   ## Modifications
   
   This change can be supported on the client side,   when throwing an 
exception need to set sequenceId
   org.apache.pulsar.client.api.PulsarClientException
   
   
   ```java
   public class PulsarClientException extends IOException {
   private long sequenceId = -1;
   
   public PulsarClientException(String msg, long sequenceId) {
   super(msg);
   this.sequenceId = sequenceId;
   }
   ```
   Client examples
   ```java
 producer.newMessage().sequenceId(1).value(value.getBytes())
   .sendAsync().thenAccept(msgId -> {
   System.out.println(msgId);
   }).exceptionally(ex -> {
   System.out.println( 
((PulsarClientException)ex.getCause()).getSequenceId());
   return null;
   });
   ```



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




[GitHub] [pulsar] liudezhi2098 opened a new issue #6824: support async send msg can get sequenceId when throw exception

2020-04-26 Thread GitBox


liudezhi2098 opened a new issue #6824:
URL: https://github.com/apache/pulsar/issues/6824


   ## Motivation
   
   When sending messages asynchronously fails, an exception will be thrown, but 
it is not known which message is abnormal, and the user does not know which 
messages need to be retried。
   
   ## Proposed changes
   
   This change can be supported on the client side,   when throwing an 
exception need to set sequenceId
   org.apache.pulsar.client.api.PulsarClientException
   
   
   ```java
   public class PulsarClientException extends IOException {
   private long sequenceId = -1;
   
   public PulsarClientException(String msg, long sequenceId) {
   super(msg);
   this.sequenceId = sequenceId;
   }
   ```
   
   



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




[GitHub] [pulsar] bschofield commented on issue #6785: go client: message ID serialization / deserialization does not work with multi-topic consumers

2020-04-26 Thread GitBox


bschofield commented on issue #6785:
URL: https://github.com/apache/pulsar/issues/6785#issuecomment-619529110


   That would be great. Otherwise I think we would have to do something like 
this:
   
   ```C++
   
   const void *pulsar_message_id_set_topic(pulsar_message_id_t *messageId, 
const char *topic) {
   std::string *p = new std::string(topic);
   messageId->messageId.setTopicName(*p);
   return (void *)p;
   }
   
   void pulsar_message_id_free_topic(void *p) {
  delete (std::string *)p;
   }
   ```
   
   ...but that seems horrible. I like your solution much better.



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




[GitHub] [pulsar] BewareMyPower commented on issue #6785: go client: message ID serialization / deserialization does not work with multi-topic consumers

2020-04-26 Thread GitBox


BewareMyPower commented on issue #6785:
URL: https://github.com/apache/pulsar/issues/6785#issuecomment-619527960


   You're right. I think the the internal `const std::string*` of `MessageImpl` 
could be changed to `const char*`. Then the relative getter / setter should be 
reimplemented.



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




[GitHub] [pulsar] bschofield commented on issue #6785: go client: message ID serialization / deserialization does not work with multi-topic consumers

2020-04-26 Thread GitBox


bschofield commented on issue #6785:
URL: https://github.com/apache/pulsar/issues/6785#issuecomment-619525256


   Take a look at the internals of the `MessageId` class. It keeps a reference 
to a `std::string`. That means that to set a topic name, a `std::string` has to 
exist somewhere in memory. You can't just create a `std::string` inside the C 
wrapper function, because when it goes out of scope the destructor gets called. 
What is your proposed solution to this?



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




[GitHub] [pulsar] BewareMyPower commented on issue #6785: go client: message ID serialization / deserialization does not work with multi-topic consumers

2020-04-26 Thread GitBox


BewareMyPower commented on issue #6785:
URL: https://github.com/apache/pulsar/issues/6785#issuecomment-619524556


   The C wrapper of `MessageId` has a `MessageId` field:
   
   ```c++
   struct _pulsar_message_id {
   pulsar::MessageId messageId;
   };
   ```
   
   And you can convert `std::string` to c-style string by:
   
   ```c++
   char* string_to_raw_c_string(const std::string& s) {
 char* c_str = static_cast(malloc(s.size() + 1));
 memcpy(c_str, s.c_str(), s.size() + 1);  // C++11 ensures that std::string 
has a '\0' terminator
 return c_str;
   }
   ```
   
   So you can implement the C functions like following code:
   
   ```c++
   void pulsar_message_set_topic_name(pulsar_message_id_t *messageId, const 
char* topicName) {
   messageId->messageId->setTopicName(topicName);
   }
   
   char* pulsar_message_get_topic_name(pulsar_message_id_t *messageId) {
   return string_to_raw_c_string(messageId->messageId->getTopicName());
   }
   ```
   
   Remind that the return value of `char*` must be freed. And use 
`PULSAR_PUBLIC` to expose these C functions. I'm not familiar with cgo (we use 
SWIG to wrap C++ client), it seems that it's convenient to convert between 
`char*` and go string in cgo.



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




[GitHub] [pulsar-translation] sijia-w opened a new pull request #28: Update schedule_zh-CN.md

2020-04-26 Thread GitBox


sijia-w opened a new pull request #28:
URL: https://github.com/apache/pulsar-translation/pull/28


   <--
   ### Contribution Checklist
 
 - Name the pull request in the form "[Issue XYZ][component] Title of the 
pull request", where *XYZ* should be replaced by the actual issue number.
   Skip *Issue XYZ* if there is no associated github issue for this pull 
request.
   Skip *component* if you are unsure about which is the best component. 
E.g. `[docs] Fix typo in produce method`.
   
 - Fill out the template below to describe the changes contributed by the 
pull request. That will give reviewers the context they need to do the review.
 
 - Each pull request should address only one issue, not mix up code from 
multiple issues.
 
 - Each commit in the pull request has a meaningful commit message
   
 - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   *(If this PR fixes a github issue, please add `Fixes #`.)*
   
   Fixes #
   
   *(or if this PR is one task of a github issue, please add `Master Issue: 
#` to link to the master issue.)*
   
   Master Issue: #
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the 
problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verify this change
   
   - [ ] Make sure that the change is correct.
   - For how to check and verify, refer to [Translation and 
localization](https://github.com/apache/pulsar/tree/master/site2#translation-and-localization).
   
   
   ### Documentation
   
 - Is this pull request related to crowdin usage? (yes / no)
 - Is this pull request related to translation quality? (yes / no)
 - If yes, how to improve? 
 - Is this pull request related to translation guidelines?(yes / no)
 - Is this pull request related to translation workflow?(yes / no)
 - If a sth is not documented yet in this PR, please create a followup 
issue for adding the documentation.
   



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




[GitHub] [pulsar] bschofield commented on issue #6785: go client: message ID serialization / deserialization does not work with multi-topic consumers

2020-04-26 Thread GitBox


bschofield commented on issue #6785:
URL: https://github.com/apache/pulsar/issues/6785#issuecomment-619516449


   Yes. I tried adding those functions to the C wrapper but I got stuck because 
`MessageId` takes a `std::string&` and there's no `std::string` in C, so 
nothing to take a reference of.
   
   I guess I could add some C wrapper functions that do `new std::string()` and 
`delete` but that feels a little weird.



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




[GitHub] [pulsar] BewareMyPower commented on issue #6785: go client: message ID serialization / deserialization does not work with multi-topic consumers

2020-04-26 Thread GitBox


BewareMyPower commented on issue #6785:
URL: https://github.com/apache/pulsar/issues/6785#issuecomment-619515641


   It's the flaw of C wrapper. C++ `MessageId` provide `setTopicName()` / 
`getTopicName()` methods, but the C wrapper doesn't have similar functions like:
   
   ```c
   void pulsar_message_set_topic_name(pulsar_message_id_t *messageId, const 
char* topicName);
   char* pulsar_message_get_topic_name(pulsar_message_id_t *messageId);
   ```



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