use of io.joynr.messaging.AtmosphereMessagingModule in project joynr by bmwcarit.
the class MyRadioConsumerApplication method getRuntimeModule.
private static Module getRuntimeModule(String transport, String host, int port, Properties joynrConfig) {
Module runtimeModule;
if (transport != null) {
if (transport.contains("websocket")) {
joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_HOST, host);
joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PORT, "" + port);
joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PROTOCOL, "ws");
joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PATH, "");
runtimeModule = new LibjoynrWebSocketRuntimeModule();
} else {
runtimeModule = new CCInProcessRuntimeModule();
}
Module backendTransportModules = Modules.EMPTY_MODULE;
if (transport.contains("http")) {
backendTransportModules = Modules.combine(backendTransportModules, new AtmosphereMessagingModule());
}
if (transport.contains("mqtt")) {
joynrConfig.put("joynr.messaging.mqtt.brokerUri", "tcp://localhost:1883");
joynrConfig.put(MessagingPropertyKeys.PROPERTY_MESSAGING_PRIMARYGLOBALTRANSPORT, "mqtt");
backendTransportModules = Modules.combine(backendTransportModules, new MqttPahoModule());
}
return Modules.override(runtimeModule).with(backendTransportModules);
}
return Modules.override(new CCInProcessRuntimeModule()).with(new MqttPahoModule());
}
use of io.joynr.messaging.AtmosphereMessagingModule in project joynr by bmwcarit.
the class UrlResolverTest method setUp.
@Before
public void setUp() throws Exception {
Properties properties = new Properties();
properties.put(MessagingPropertyKeys.CHANNELID, channelId);
Injector injector = Guice.createInjector(new JoynrPropertiesModule(properties), new MessagingTestModule(), new AtmosphereMessagingModule(), new AbstractModule() {
@Override
protected void configure() {
bind(RequestConfig.class).toProvider(HttpDefaultRequestConfigProvider.class).in(Singleton.class);
bind(MessageRouter.class).toInstance(mockMessageRouter);
Multibinder.newSetBinder(binder(), new TypeLiteral<JoynrMessageProcessor>() {
});
}
});
urlResolver = injector.getInstance(UrlResolver.class);
}
use of io.joynr.messaging.AtmosphereMessagingModule in project joynr by bmwcarit.
the class HttpCommunicationManagerTest method setUp.
@Before
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "correct use of RestAssured API")
public void setUp() throws Exception {
RestAssured.port = port;
String basePath = "/bounceproxy/";
RestAssured.basePath = basePath;
bounceProxyUrlString = "http://localhost:" + port + basePath;
Properties properties = new Properties();
properties.put(MessagingPropertyKeys.CHANNELID, testChannelId);
properties.put(MessagingPropertyKeys.BOUNCE_PROXY_URL, bounceProxyUrlString);
Injector injector = Guice.createInjector(new JoynrPropertiesModule(properties), new MessagingTestModule(), new AtmosphereMessagingModule(), new AbstractModule() {
@Override
protected void configure() {
bind(RequestConfig.class).toProvider(HttpDefaultRequestConfigProvider.class).in(Singleton.class);
bind(MessageRouter.class).toInstance(mockMessageRouter);
Multibinder.newSetBinder(binder(), new TypeLiteral<JoynrMessageProcessor>() {
});
}
});
longpollingMessageReceiver = injector.getInstance(LongPollingMessageReceiver.class);
}
Aggregations