Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7D133200C5D for ; Fri, 24 Mar 2017 05:20:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7B938160B84; Fri, 24 Mar 2017 04:20:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF60B160B83 for ; Fri, 24 Mar 2017 05:20:32 +0100 (CET) Received: (qmail 65197 invoked by uid 500); 24 Mar 2017 04:20:31 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 65186 invoked by uid 99); 24 Mar 2017 04:20:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Mar 2017 04:20:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id F0FFCC0027 for ; Fri, 24 Mar 2017 04:20:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.966 X-Spam-Level: * X-Spam-Status: No, score=1.966 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_NONE=-0.0001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Qwjj3DuY8gaG for ; Fri, 24 Mar 2017 04:20:28 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id DC0095FAD1 for ; Fri, 24 Mar 2017 04:20:27 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mbob.nabble.com (Postfix) with ESMTP id EA45D3F911D4 for ; Thu, 23 Mar 2017 20:55:14 -0700 (PDT) Date: Thu, 23 Mar 2017 21:20:25 -0700 (MST) From: alapaka To: users@camel.apache.org Message-ID: <1490329225475-5796061.post@n5.nabble.com> Subject: concurrentConsumers, failIfNoConsumers confusion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Fri, 24 Mar 2017 04:20:33 -0000 Hi All; I am trying to implement a route that can process only one message at a time; the route should reject incoming messages if it is busy. To be clear, I do not want messages to be queued for processing, I want them to be rejected and discarded, preferably with an exception returned to the caller. It would seem that some combination of options on a seda endpoint should do the trick, however I am not able to achieve this functionality. Here is my test code, running on camel 2.16.3 in ServiceMix 6.1.2: from("seda:test-server?concurrentConsumers=1&failIfNoConsumers=true&multipleConsumers=false") .log("test server - got request...") .delay(15000) .log("test server - sending reply") .routeId("test-server"); from("direct-vm:test-client") .log("test client calling server") .to("seda:test-server?concurrentConsumers=1&failIfNoConsumers=true&multipleConsumers=false") .log("test client got reply") .routeId("test-client"); output from calling the "test-client" route 7 times in less than 10 seconds: 2017-03-24 15:09:03,756 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:03,757 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:03,757 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:09:04,392 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:04,393 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:05,073 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:05,074 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:07,997 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:07,998 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:11,228 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:11,229 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:11,923 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:11,924 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:12,552 | 126 - org.apache.camel.camel-core - 2.16.3 | test client calling server 2017-03-24 15:09:12,552 | 126 - org.apache.camel.camel-core - 2.16.3 | test client got reply 2017-03-24 15:09:18,760 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply 2017-03-24 15:09:18,761 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:09:33,762 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply 2017-03-24 15:09:33,763 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:09:48,765 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply 2017-03-24 15:09:48,766 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:10:03,767 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply 2017-03-24 15:10:03,768 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:10:18,770 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply 2017-03-24 15:10:18,771 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:10:33,772 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply 2017-03-24 15:10:33,773 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - got request... 2017-03-24 15:10:48,775 | 126 - org.apache.camel.camel-core - 2.16.3 | test server - sending reply I have tried just about every combination of options on both server and client, yet no joy. I know there are other ways to implement this e.g. activemq, database lock, thread pool? etc... however I would rather a cleaner solution, handled simply at the incoming endpoint - if that is indeed possible. -- View this message in context: http://camel.465427.n5.nabble.com/concurrentConsumers-failIfNoConsumers-confusion-tp5796061.html Sent from the Camel - Users mailing list archive at Nabble.com.