Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius Web Subscription
Sirius Web Subscription [message #1853494] Tue, 05 July 2022 10:14 Go to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Hello,

I'm trying to follow the instruction on the recent siriuscon.

I don't get the code in SubscriptionMapEventDataFetcher.java

This method return a Publisher<IPayload>
 @Override
    public Publisher<IPayload> get(DataFetchingEnvironment environment) throws Exception {
        Object argument = environment.getArgument("input"); //$NON-NLS-1$
        var input = this.objectMapper.convertValue(argument, MapEventInput.class);
        var mapConfiguration = new MapConfiguration(input.getMapId());
        
        return this.editingContextEventProcessorRegistry.getOrCreateEditingContextEventProcessor(input.getEditingContextId())
                .flatMap(processor -> processor.acquireRepresentationEventProcessor(IMapEventProcessor.class, mapConfiguration, input))
                .map(representationEventProcessor -> representationEventProcessor.getOutputEvents(input)).orElse(Flux.empty());
    }


but inside this method we return a call to getOutputEvents that returns a Flux<IPayload>

    @Override
    public Flux<IPayload> getOutputEvents(IInput input) {
        return Flux.merge(this.mapEventFlux.getFlux(input), this.subscriptionManager.getFlux(input));
    }
Re: Sirius Web Subscription [message #1853495 is a reply to message #1853494] Tue, 05 July 2022 12:11 Go to previous messageGo to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
I'm using JdkFlowAdapter.publisherToFlowPublisher to convert the flux.
I still have an error : Your data fetcher must return a Publisher of events when using graphql subscriptions.
But this may not be related.
Re: Sirius Web Subscription [message #1853497 is a reply to message #1853495] Tue, 05 July 2022 14:23 Go to previous message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
I was importing the wrong package.
import java.util.concurrent.Flow; instead of import reactor.core.publisher.Flux;

This works well now.
Previous Topic:Tables support in Sirius Web
Next Topic:Sirius web representationId
Goto Forum:
  


Current Time: Thu Apr 25 08:06:08 GMT 2024

Powered by FUDForum. Page generated in 0.03159 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top