congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MessageHandlerOptions
Code IndexAdd Tabnine to your IDE (free)

How to use
MessageHandlerOptions
in
com.microsoft.azure.servicebus

Best Java code snippets using com.microsoft.azure.servicebus.MessageHandlerOptions (Showing top 8 results out of 315)

origin: Azure/azure-service-bus-java

@Deprecated
@Override
public void registerMessageHandler(IMessageHandler handler) throws InterruptedException, ServiceBusException {
  this.registerMessageHandler(handler, new MessageHandlerOptions());
}    

origin: Azure/azure-service-bus-java

private void receiveAndPumpMessage() {
  if (!this.getIsClosingOrClosed()) {
    CompletableFuture<IMessage> receiveMessageFuture = this.innerReceiver.receiveAsync(this.messageHandlerOptions.getMessageWaitDuration());
    receiveMessageFuture.handleAsync((message, receiveEx) -> {
      if (receiveEx != null) {
            Instant stopRenewMessageLockAt = Instant.now().plus(this.messageHandlerOptions.getMaxAutoRenewDuration());
            renewLockLoop = new MessgeRenewLockLoop(this.innerReceiver, this, message, stopRenewMessageLockAt);
            renewLockLoop.startLoop();
                if (this.messageHandlerOptions.isAutoComplete()) {
                  TRACE_LOGGER.debug("Completing message with sequence number '{}'", message.getSequenceNumber());
                  updateDispositionFuture = this.innerReceiver.completeAsync(message.getLockToken());
                if(this.messageHandlerOptions.isAutoComplete())
origin: Azure/azure-service-bus-java

@Override
public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService) throws InterruptedException, ServiceBusException {
  assertNonNulls(handler, handlerOptions, executorService);
  TRACE_LOGGER.info("Registering message handler on entity '{}' with '{}'", this.entityPath, handlerOptions);
  this.setHandlerRegistered();
  this.messageHandler = handler;
  this.messageHandlerOptions = handlerOptions;
  this.customCodeExecutor = executorService;
  this.innerReceiver = ClientFactory.createMessageReceiverFromEntityPath(this.factory, this.entityPath, this.entityType, this.receiveMode);
  TRACE_LOGGER.info("Created MessageReceiver to entity '{}'", this.entityPath);
  if(this.prefetchCount != UNSET_PREFETCH_COUNT)
  {
    this.innerReceiver.setPrefetchCount(this.prefetchCount);
  }
  for (int i = 0; i < handlerOptions.getMaxConcurrentCalls(); i++) {
    this.receiveAndPumpMessage();
  }
}
origin: Azure/azure-service-bus-java

@Override
public void registerMessageHandler(IMessageHandler handler, ExecutorService executorService) throws InterruptedException, ServiceBusException {
  this.registerMessageHandler(handler, new MessageHandlerOptions(), executorService);
}
origin: Microsoft/azure-spring-boot

@PostConstruct
private void postConstruct() {
  LOG.debug("postConstruct start...");
  try {
    LOG.debug("registering queue handler...");
    queueClientForReceiving.registerMessageHandler(new MessageHandler(),
        new MessageHandlerOptions());
    LOG.debug("done registering handlers...");
  } catch (InterruptedException e) {
    LOG.error("Error registering message handler", e);
  } catch (ServiceBusException e) {
    LOG.error("Error registering message handler", e);
  }
  LOG.debug("postConstruct end.");
}
origin: Microsoft/azure-spring-boot

private void receiveSubscriptionMessage() throws ServiceBusException, InterruptedException {
  subscriptionClient.registerMessageHandler(new MessageHandler(), new MessageHandlerOptions());
  TimeUnit.SECONDS.sleep(5);
  subscriptionClient.close();
}
origin: Microsoft/azure-spring-boot

private void receiveQueueMessage() throws ServiceBusException, InterruptedException {
  queueClient.registerMessageHandler(new MessageHandler(), new MessageHandlerOptions());
  TimeUnit.SECONDS.sleep(5);
  queueClient.close();
}
origin: commercetools/commercetools-jvm-sdk

  private static void receiveMessages(QueueClient queueClient) throws InterruptedException, ServiceBusException {

    queueClient.registerMessageHandler(new IMessageHandler() {

      public CompletableFuture<Void> onMessageAsync(IMessage message) {
        return CompletableFuture.completedFuture(null);
      }

      public void notifyException(Throwable exception, ExceptionPhase phase) {}
    }, new MessageHandlerOptions(10000, true, Duration.ofMinutes(2)));
  }
}
com.microsoft.azure.servicebusMessageHandlerOptions

Javadoc

The OnMessage handler processing options.

Most used methods

  • <init>
  • getMaxAutoRenewDuration
    Gets the maximum duration within which the lock will be renewed automatically. This value should be
  • getMaxConcurrentCalls
    Gets the maximum number of concurrent calls to the callback the message pump should initiate.
  • getMessageWaitDuration
    Gets the time to wait for receiving a message. Defaults to 1 minute.
  • isAutoComplete
    Whether the auto complete is set to true.

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now