Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

RxJava Observables support for Spring REST plugin #1842

Description

@marcin-jelenski

Hi,

I would like to ask if there are plans to add support for RxJava within rest-spring plugin, before I create new one.

For now, if somebody's using Observables and annotation-generated @restservice, this code has to be constantly repeated:

Observable.fromCallable(new Callable<String>()
{
    @Override
    public String call() throws Exception
    {
        return testRestService.getIndex();
    }
})

It would be nice to return Observable from Rest interface, like this:

@Rest(
    // ...
)
public interface TestRestService
{

    @Get("/")
    Observable<String> getIndex();

}

I've tried to implement custom message converter, but with no luck. Compilation fails after using parameterized type as a result (as shown above):

error: constructor Observable in class Observable<T> cannot be applied to given types;
required: OnSubscribe<String>
found: no arguments
reason: actual and formal argument lists differ in length
where T is a type-variable:
T extends Object declared in class Observable

Looking forward to hearing from you.

Activity

  1. dodgex commented on Aug 27, 2016

    @dodgex
    Member

    afaik there is no such plan right now. but i think you could try to contribute that feature so there would be no need for a complete new plugin.

  2. WonderCsabo commented on Aug 29, 2016

    @WonderCsabo
    Member

    This was already requested in #1816, however i mark that one as a duplicate as this issue is better scoped. I agree this would be a great addition to AA-REST, but currently i do not have time to implement this. Contributions are welcome, as always!

  3. JackRo commented on Aug 29, 2016

    @JackRo

    @marcin-jelenski your issue is so cool

  4. marcin-jelenski commented on Aug 29, 2016

    @marcin-jelenski
    Author

    As soon as I have more time to dive into AA, I will try to contribute this module (and maybe others) to support react components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions