Skip to content

[Issue 4347] ClientAPI ReaderBuilder.loadConf() not working#4382

Merged
codelipenghui merged 1 commit intoapache:masterfrom
ambition119:issue-4347
Jun 13, 2019
Merged

[Issue 4347] ClientAPI ReaderBuilder.loadConf() not working#4382
codelipenghui merged 1 commit intoapache:masterfrom
ambition119:issue-4347

Conversation

@ambition119
Copy link
Contributor

@ambition119 ambition119 commented May 27, 2019

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #4347

Motivation

MessageId is a interface, not support mapper.readValue() from conf.set("startMessageId", new MessageIdImpl()) .
If support, modify code to mapper.forType(MessageIdImpl.class) or use jackson annotation

@JsonTypeInfo(
  use = JsonTypeInfo.Id, 
  include = JsonTypeInfo.As.PROPERTY, 
  property = "type")
@JsonSubTypes({ 
  @Type(value = MessageIdImpl.class), 
  @Type(value = BatchMessageIdImpl.class) ,
  @Type(value = TopicMessageIdImpl.class) 
})
public interface MessageId

so I thank use @JsonIgnore then builder.startMessageId() is the easiest solution.

Modifications

  1. @JsonIgnore startMessageId
  2. conf.setStartMessageId()

Verifying this change

  • [✔️ ] Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)
  • The rest endpoints: (yes / no)
  • The admin cli options: (yes / no)
  • Anything that affects deployment: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ambition119 can you write a unit test to reproduce this issue? so that we can confirm that your pull request fixes it.

@sijie sijie added this to the 2.4.0 milestone May 27, 2019
@sijie sijie added the type/bug The PR fixed a bug or issue reported a bug label May 27, 2019
@ambition119
Copy link
Contributor Author

@ambition119 can you write a unit test to reproduce this issue? so that we can confirm that your pull request fixes it.

done, this solve like https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ConsumerConfigurationData.java#L62

@sijie
Copy link
Member

sijie commented Jun 1, 2019

@ambition119 can you rebase your pull request to latest master to fix the integration tests error?

@ambition119
Copy link
Contributor Author

run java8 tests

org.apache.pulsar.functions.worker.PulsarFunctionE2ESecurityTest.testAuthorizationWithAnonymousUser

@sijie
Copy link
Member

sijie commented Jun 9, 2019

run java8 tests

@codelipenghui codelipenghui merged commit 5a9dbab into apache:master Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ClientAPI]ReaderBuilder.loadConf() not working

3 participants