Package io.vertx.ext.web.api.service
Interface RouteToEBServiceHandler
-
- All Superinterfaces:
Handler<RoutingContext>
public interface RouteToEBServiceHandler extends Handler<RoutingContext>
Handler that proxy the request to an event bus endpoint, waits for the reply and then writes the HTTP response.
The HTTP request is sent encapsulated into aServiceRequest
object through the event bus. The expected reply is aServiceResponse
This handler requires aValidationHandler
that process request parameters, so they can be encapsulated by this handler inside theServiceRequest
- Author:
- Francesco Guardiani @slinkydeveloper
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static RouteToEBServiceHandler
build(EventBus eventBus, String address, String actionName)
Build a newRouteToEBServiceHandler
static RouteToEBServiceHandler
build(EventBus eventBus, String address, String actionName, DeliveryOptions deliveryOptions)
Build a newRouteToEBServiceHandler
RouteToEBServiceHandler
extraPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraPayloadMapper)
WhenextraPayloadMapper
is configured, this handler puts the evaluation result intoServiceRequest.getExtra()
-
-
-
Method Detail
-
extraPayloadMapper
RouteToEBServiceHandler extraPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraPayloadMapper)
WhenextraPayloadMapper
is configured, this handler puts the evaluation result intoServiceRequest.getExtra()
- Parameters:
extraPayloadMapper
- mapper- Returns:
-
build
static RouteToEBServiceHandler build(EventBus eventBus, String address, String actionName)
Build a newRouteToEBServiceHandler
- Parameters:
eventBus
- Vert.x event bus instanceaddress
- Event bus endpoint addressactionName
- action name of the endpoint. This will be configured asDeliveryOptions
header namedaction
- Returns:
-
build
static RouteToEBServiceHandler build(EventBus eventBus, String address, String actionName, DeliveryOptions deliveryOptions)
Build a newRouteToEBServiceHandler
- Parameters:
eventBus
- Vert.x event bus instanceaddress
- Event bus endpoint addressactionName
- action name of the endpoint. This will be configured asDeliveryOptions
header namedaction
deliveryOptions
- delivery options that will be always sent with the request- Returns:
-
-