flowchartsman opened a new issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434


   #### Expected behavior
   
   When a topic is deleted, a regex subscriber should simply gracefully close 
the individual consumer and move on.
   
   #### Actual behavior
   
   As I mention in #432, the client throws a series of scary-looking errors as 
it attempts to resubscribe to the topic, but is blocked by its own specified 
desire not to create new topics. It then retries the operation a series of 
times. 
   
   #### Steps to reproduce
   
   As with #432, once #433 is applied.
   
   #### Suggested fix
   Since the consumer already knows it doesn't want to create a new topic, and 
since the error returned from the server explicitly states that the topic 
doesn't exist, the consumer could put two and two together and realize that it 
shouldn't keep retrying the consumer. Unfortunately, at the moment, the error 
is returned from `connection.handleResponseError()` as a string:
   
   ```go
   errMsg := fmt.Sprintf("server error: %s: %s", serverError.GetError(), 
serverError.GetMessage())
   ```
   
   Since `handleResponseError()` already has the `*pb.CommandError`, it could 
conceivably wrap the message in a type like the following
   
   ```go
   type commandError struct {
       serverErrorType string
       serverErrorMsg string
   }
   ```
   
   Because `ServerError` [is a proto 
enum](https://github.com/apache/pulsar/blob/73e0dbd4df36571460eeb070964ec498d1955c1d/pulsar-common/src/main/proto/PulsarApi.proto#L189),
 it should be safe enough to just call `Enum().String()` and select off of that 
when handling the error.
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to