Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pause and resume for inbound binders #57

Closed
wants to merge 1 commit into from
Closed

pause and resume for inbound binders #57

wants to merge 1 commit into from

Conversation

nathanaelweber
Copy link

@nathanaelweber nathanaelweber commented Jan 22, 2021

If multiple services want to pause their receiving repetitive, calculate something heavy, and resume all at once again, they don't want to create and stop a new connection. Therefore pause and resume is required at least on the inbound side. The part within InboundXMLMessageListener is tested and works.

Unit tests will be provided later, im still on that.

Can somebody provide an example how a user would actually use the "pollable binder" feature within class "JCSMPMessageSource"?
With that we could test the code in JCSMPMessageSource as well, but actually i see only the way with unit-tests.

@Nephery
Copy link
Collaborator

Nephery commented Jan 22, 2021

Just to confirm, but is this PR implementing the actuator pause/resume endpoints feature or is this something else?

If multiple services want to pause their receiving repetitive, calculate something heavy, and resume all at once again, they don't want to create and stop a new connection. Therefore pause and resume is required at least on the inbound side. The part within InboundXMLMessageListener is tested and works.

Are these services trying to stop their own consumers or remotely stopping other applications' consumers? Because if its the former, then have you tried using pollable consumers? Because if you're using a pollable consumer, then you could just stop polling to "pause" it.

Can somebody provide an example how a user would actually use the "pollable binder" feature within class "JCSMPMessageSource"?
With that we could test the code in JCSMPMessageSource as well, but actually i see only the way with unit-tests.

JCSMPMessageSource is used for pollable consumers. Here's the documentation for it: https://docs.spring.io/spring-cloud-stream/docs/3.1.0/reference/html/spring-cloud-stream.html#spring-cloud-streams-overview-using-polled-consumers

@GreenRover
Copy link
Contributor

@Nephery Yes the pause & resume can be triggered via those actuator endpoints.
But our use case is it to do this programatic. like:

public class ProgrammaticStartStopController {
    @AutoWired
    private MessagingEndpoints endpoints;

    @GetMapping(value = "/start/endpoint/{endpoint}")
    public void startReceiveAll(
            @PathVariable("endpoint") final String endpoint) {
        if(endpoint.contentEquals("all")) {
            endpoints.startEndpoints();
        } else {
            endpoints.startEndpoint(endpoint);
        }
    }

    @GetMapping(value = "/resume/endpoint/{endpoint}")
    public void resumeReceiveAll(
            @PathVariable("endpoint") final String endpoint) {
        if(endpoint.contentEquals("all")) {
            endpoints.resumeEndpoints();
        } else {
            endpoints.resumeEndpoint(endpoint);
        }
    }

    @GetMapping(value = "/pause/endpoint/{endpoint}")
    public void pauseReceiveAll(
            @PathVariable("endpoint") final String endpoint) {
        if(endpoint.contentEquals("all")) {
            endpoints.pauseEndpoints();
        } else {
            endpoints.pauseEndpoint(endpoint);
        }
    }

    @GetMapping(value = "/stop/endpoint/{endpoint}")
    public void stopReceiveAll(
            @PathVariable("endpoint") final String endpoint) {
        if(endpoint.contentEquals("all")) {
            endpoints.stopEndpoints();
        } else {
            endpoints.stopEndpoint(endpoint);
        }
    }

}

@nathanaelweber
Copy link
Author

Hi all
The IT tests are now added in code, plus some documentation for the usage.

@GreenRover
Copy link
Contributor

I rebased to be able to merge

@Nephery Nephery changed the base branch from stage-2.0.0 to stage-2.1.0 February 25, 2021 19:39
@Nephery Nephery changed the base branch from stage-2.1.0 to stage-2.0.0 February 25, 2021 21:46
@GreenRover
Copy link
Contributor

@Nephery how we can make progress here?

@mackenza
Copy link
Contributor

@GreenRover I apologize for not responding sooner to this.

@Nephery is currently engaged with another project that is taking up most of his time. We did a number of releases in a short time on the SCSt Binders and we are going to come back to them soon, but I don't think we are going to get to this or other PRs in the next month or 2.

We truly appreciate your support and contributions to the project and don't want to dissuade you from further contributions, it's just a reality that our core development has many projects, commercial and open source, to maintain and we might be a bit slow to get to some PRs/Issues.

Regards,
Andrew MacKenzie

@GreenRover
Copy link
Contributor

@mackenza any updates here? Do we have a time line?

@Nephery Nephery mentioned this pull request Mar 10, 2022
@Nephery
Copy link
Collaborator

Nephery commented Mar 10, 2022

@nathanaelweber Thank you for opening this pull request. We've added support for consumer pause/resume in #123 to be released in the 2.3.0 solace-spring-cloud release.

Closing this pull request as a duplicate of #123.

@Nephery Nephery closed this Mar 10, 2022
@Nephery Nephery added the duplicate This issue or pull request already exists label Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants