use of io.vertx.core.eventbus.EventBus in project Summer by yale8848.
the class DXHResource method dxh.
@Path("/dxh/{dxhv}")
@GET
public void dxh(@PathParam("dxhv") String dxh, @Context Vertx vertx, @Context HttpServerResponse response) {
dxh = "8454005";
// WebClient client = WebClient.create(vertx);
// HttpUtils.oneDXH(client,response,dxh,vertx);
// response.end(dxh);
/* try {
EventBus eb = vertx.eventBus();
EventMessage eventMessage=EventMessage.message(null);
eventMessage.setKey("68257");
Message<EventMessage> reply = awaitResult(h -> eb.send("aaa", eventMessage, h));
//Message<EventMessage> reply1 = awaitResult(h -> eb.send("aaa", eventMessage, h));
response.end(reply.body().getMessage());
}catch (Exception e){
response.end(e.getMessage());
}*/
EventBus eb = vertx.eventBus();
EventMessage eventMessage = EventMessage.message(null);
eventMessage.setKey("68257");
// Message<EventMessage> reply = awaitResult(h -> eb.send("aaa", eventMessage, h));
// Message<EventMessage> reply1 = awaitResult(h -> eb.send("aaa", eventMessage, h));
// response.end(reply.body().getMessage());
}
use of io.vertx.core.eventbus.EventBus in project hono by eclipse.
the class FileBasedCredentialsServiceTest method setUp.
/**
* Sets up fixture.
*/
@Before
public void setUp() {
fileSystem = mock(FileSystem.class);
Context ctx = mock(Context.class);
eventBus = mock(EventBus.class);
vertx = mock(Vertx.class);
when(vertx.eventBus()).thenReturn(eventBus);
when(vertx.fileSystem()).thenReturn(fileSystem);
props = new FileBasedCredentialsConfigProperties();
svc = new FileBasedCredentialsService();
svc.setConfig(props);
svc.init(vertx, ctx);
}
use of io.vertx.core.eventbus.EventBus in project hono by eclipse.
the class FileBasedRegistrationServiceTest method setUp.
/**
* Sets up the fixture.
*/
@Before
public void setUp() {
fileSystem = mock(FileSystem.class);
Context ctx = mock(Context.class);
eventBus = mock(EventBus.class);
vertx = mock(Vertx.class);
when(vertx.eventBus()).thenReturn(eventBus);
when(vertx.fileSystem()).thenReturn(fileSystem);
props = new FileBasedRegistrationConfigProperties();
props.setFilename(FILE_NAME);
registrationService = new FileBasedRegistrationService();
registrationService.setConfig(props);
registrationService.init(vertx, ctx);
}
use of io.vertx.core.eventbus.EventBus in project hono by eclipse.
the class FileBasedTenantServiceTest method setUp.
/**
* Sets up fixture.
*/
@Before
public void setUp() {
fileSystem = mock(FileSystem.class);
Context ctx = mock(Context.class);
eventBus = mock(EventBus.class);
vertx = mock(Vertx.class);
when(vertx.eventBus()).thenReturn(eventBus);
when(vertx.fileSystem()).thenReturn(fileSystem);
props = new FileBasedTenantsConfigProperties();
svc = new FileBasedTenantService();
svc.setConfig(props);
svc.init(vertx, ctx);
}
Aggregations