Comments (4)
Hey @lz000 π Thanks for the interesting question! When setting up an event listener, like app.message
, the event is registered to an events dispatcher for your app and I don't believe these events can be deregistered once added.
Replacing an existing event listener with a different one, however, does seem possible by replacing an existing handler with the latest. This applies to most events except for message
, which has handlers appended to the list of listeners instead.
I hope this helps but let me know if this is giving you any troubles! I'm also curious if you're trying to re-register certain events or the message one specifically? Some logic within a listener might be another approach to deregister a listener without removing it from the list of event handlers too, but might not be ideal.
from java-slack-sdk.
Specifically talking about app.message
listener user case, I would recommend having one large app.event(MessageEvent.class)
listener and having your own dispatcher within it. This approach offers greater flexibility and eliminates the need to focus on Bolt-specific details.
from java-slack-sdk.
@seratch thanks. That wouldn't work for our case, because when we want un-register, we don't want the app to get message from slack at all. With your approach, the app still retrieve message but just ignored. We have 2 instances. We want 1 instance retrieve message, they other one unregister so it does not compete message with the first one. We want to make this dynamic, so we can control which instance to register and unregister
from java-slack-sdk.
Ah I see. Unfortunately, bolt and the Slack platform do not provide a feature that meets your needs. The only approach I can suggest is to have a proxy server in front of your bolt app instances and let the proxy server do a kind of load balancing like you mentioned.
I understand this is not a great answer for you but we donβt have anything else to share on this matter. If everything is clear to you so far, would you mind closing this issue? You can submit new ones whenever you have new but similar questions.
from java-slack-sdk.
Related Issues (20)
- Slack mobile shows "Unable to show preview" despite fallback text() being present HOT 3
- AdminInviteRequestsListRequest missing an optional argument HOT 3
- How to know when the end of a cursor-iteration was reached? HOT 3
- Slack fails to stop metrics and OkHTTPClient threads when calling *.close() HOT 3
- `auth.test` in `MultiTeamsAuthorization` HOT 10
- Add documentation for using the `SlackSignature` verifier from `app_backend` with specific Java requirements HOT 2
- MarkdownTextObject as text in OptionObject entries for StaticSelectElements HOT 2
- Question: Is it possible to add ViewState to blockSuggestion events? HOT 5
- Request for Exact Size Limit of Timestamp (ts) Field in Java Slack SDK HOT 2
- Use the slack huddle api HOT 1
- maven distro of slack-api-client imports okhttp v4.9.3. Should be v4.12.0. HOT 2
- Slack couldn't verify messages with *(bold) w/ Spring Boot HOT 1
- Message sent after file upload comes earlier than the file appears in the channel HOT 4
- ResponseMetadata missing in AdminInviteRequestsResponse HOT 2
- FileUploadV2 is breaking two useful features available in pervious version HOT 9
- entity.message is missing in Audit Logs API response HOT 1
- files.upload v2 method does not upload multiple files with full metadata HOT 5
- Slack API that allows me to call to install an app on a specific channel and remove an app on a specific channel HOT 7
- How do I respond to the url_verification event? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-slack-sdk.