Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/dist/conf/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# The port that the microservice will listen on
port: 8080
# EventBus Send Timeout in ms - default in microservice is 15000
# see http://vertx.io/docs/apidocs/constant-values.html#io.vertx.core.eventbus.DeliveryOptions.DEFAULT_TIMEOUT
event-bus-send-timeout: 15000
# OMERO server that the microservice will communicate with (as a client)
omero:
host: localhost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import io.vertx.core.Promise;
import io.vertx.core.ThreadingModel;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.eventbus.Message;
import io.vertx.core.eventbus.ReplyException;
import io.vertx.core.http.HttpServer;
Expand Down Expand Up @@ -93,6 +94,9 @@ public class ThumbnailMicroserviceVerticle extends AbstractVerticle {
/** VerticleFactory */
private OmeroVerticleFactory verticleFactory;

/** DeliveryOptions (including event bus send timeout) */
private DeliveryOptions deliveryOptions;

/** Default number of workers to be assigned to the worker verticle */
private int DEFAULT_WORKER_POOL_SIZE;

Expand Down Expand Up @@ -213,6 +217,11 @@ public void deploy(JsonObject config, Promise<Void> promise) {
httpTracing = HttpTracing.newBuilder(tracing).build();
log.info("Deploying verticle");

deliveryOptions = new DeliveryOptions()
.setSendTimeout(Optional.ofNullable(
config.getInteger("event-bus-send-timeout")
).orElse(15000));

JsonObject jmxMetricsConfig =
config.getJsonObject("jmx-metrics", new JsonObject());
Boolean jmxMetricsEnabled =
Expand Down Expand Up @@ -402,7 +411,7 @@ private void renderThumbnail(RoutingContext event) {
thumbnailCtx.injectCurrentTraceContext();
vertx.eventBus().<byte[]>request(
ThumbnailVerticle.RENDER_THUMBNAIL_EVENT,
Json.encode(thumbnailCtx), result -> {
Json.encode(thumbnailCtx), deliveryOptions, result -> {
try {
if (handleResultFailed(result, response)) {
return;
Expand Down Expand Up @@ -451,7 +460,7 @@ private void getThumbnails(RoutingContext event) {

vertx.eventBus().<String>request(
ThumbnailVerticle.GET_THUMBNAILS_EVENT,
Json.encode(thumbnailCtx), result -> {
Json.encode(thumbnailCtx), deliveryOptions, result -> {
try {
if (handleResultFailed(result, response)) {
return;
Expand Down
Loading