Skip to content

Conversation

@shravannarayan-es
Copy link

PIP: 332

Motivation

Currently we are able to peek any number of messages of a topic subscription backlog using the Pulsar Java Admin API.

However, we are only able to view these messages starting from the most recent message i.e messagePosition of 1. If we want to view the 100th message, we have to peek all the top 100 messages.

When the number of messages is large, we want to split them by paging them and displaying them on the UI. So, we would like the ability to view any batch of messages instead of all of the top messages. With the messagePosition and numberOfMessages that should be fairly straightforward to do.

Modifications

The Pulsar Admin API in Java currently provides a way to peek messages using this

This function includes a default hardcoded messagePosition value of 1. We want to give the user the option to input a different messagePosition value.

The current peekMessages(String topic, String subName, int numMessages) method will remain the same and use messagePosition of 1.

We will be overloading this method with messagePosition. It will default to 1 if not specified.

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.

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

Matching PR in forked repository

PR in forked repository:

hangc0276 and others added 30 commits December 4, 2023 17:33
### Motivation

See pip: apache#21129

### Modifications

Add  `QuotaResources`
…ice channel monitor interval configs. Handle AddEntry failure during topic transfer (apache#21668)
…root (apache#21084)

### Motivation

Currently, the user pulsar is in the root group, it would be better to use the non-root group to keep more safety. 

### Modifications

- Add group pulsar (GID 10000) 
- Add user pulsar (UID 10000) to group pulsar
…tead of root" (apache#21691)

Reverts apache#21084. Because the change breaks OpenShift support.
…pache#21684)

Fixes apache#21557

### Motivation

There is a network package loss issue after enabling `haProxyProtocolEnabled`, which leads the error `Checksum failed on the broker` and `Adjusted frame length exceeds`, you can reproduce the issue by the test `testSlowNetwork`. 

### Modifications

Fix the bug.
Fixes apache#21501

### Motivation

No need to `synchronized` the method `isLeader` in LeaderService

See the deadlock stack :
```
"pulsar-external-listener-44525-1":
	at org.apache.pulsar.functions.worker.FunctionMetaDataManager.giveupLeadership(FunctionMetaDataManager.java)
	- waiting to lock <0x0000100013535c90> (a org.apache.pulsar.functions.worker.FunctionMetaDataManager)
	at org.apache.pulsar.functions.worker.LeaderService.becameInactive(LeaderService.java:167)
	- locked <0x000010001344c6d8> (a org.apache.pulsar.functions.worker.LeaderService)
	at org.apache.pulsar.client.impl.ConsumerImpl.lambda$activeConsumerChanged$27(ConsumerImpl.java:1136)
	at org.apache.pulsar.client.impl.ConsumerImpl$$Lambda$2606/0x00007f854ce9cb10.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:635)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run([email protected]/Thread.java:833)
"pulsar-web-44514-6":
	at org.apache.pulsar.functions.worker.LeaderService.isLeader(LeaderService.java)
	- waiting to lock <0x000010001344c6d8> (a org.apache.pulsar.functions.worker.LeaderService)
	at org.apache.pulsar.functions.worker.SchedulerManager.scheduleInternal(SchedulerManager.java:200)
	at org.apache.pulsar.functions.worker.SchedulerManager.schedule(SchedulerManager.java:229)
	at org.apache.pulsar.functions.worker.FunctionMetaDataManager.updateFunctionOnLeader(FunctionMetaDataManager.java:251)
	- locked <0x0000100013535c90> (a org.apache.pulsar.functions.worker.FunctionMetaDataManager)
	at org.apache.pulsar.functions.worker.rest.api.ComponentImpl.internalProcessFunctionRequest(ComponentImpl.java:1775)
	at org.apache.pulsar.functions.worker.rest.api.ComponentImpl.updateRequest(ComponentImpl.java:996)
	at org.apache.pulsar.functions.worker.rest.api.FunctionsImpl.registerFunction(FunctionsImpl.java:222)
	at org.apache.pulsar.broker.admin.impl.FunctionsBase.registerFunction(FunctionsBase.java:196)
```
…zk when revoke subscription permission (apache#21696)

Co-authored-by: fanjianye <[email protected]>
Co-authored-by: Jiwe Guo <[email protected]>
lhotari and others added 24 commits March 13, 2024 11:01
Master apache#21271
### Motivation
The proposal will introduce a new API to refresh the table view with the latest written data on the topic, ensuring that all subsequent reads are based on the refreshed data.
@github-actions github-actions bot added the doc-required Your PR changes impact docs and you will update later. label Mar 19, 2024
@shravannarayan-es shravannarayan-es marked this pull request as draft March 19, 2024 12:50
@shravannarayan-es shravannarayan-es changed the base branch from branch-2.11 to master March 19, 2024 13:01
@shravannarayan-es shravannarayan-es changed the base branch from master to branch-2.11 March 19, 2024 13:28
@shravannarayan-es shravannarayan-es deleted the peekNthWithPosition branch April 29, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-required Your PR changes impact docs and you will update later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.