From user-return-3216-apmail-uima-user-archive=uima.apache.org@uima.apache.org Tue Oct 12 06:44:21 2010 Return-Path: Delivered-To: apmail-uima-user-archive@www.apache.org Received: (qmail 68485 invoked from network); 12 Oct 2010 06:44:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Oct 2010 06:44:21 -0000 Received: (qmail 78065 invoked by uid 500); 12 Oct 2010 06:44:21 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 77781 invoked by uid 500); 12 Oct 2010 06:44:18 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 77754 invoked by uid 99); 12 Oct 2010 06:44:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 06:44:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [213.145.99.122] (HELO mail.tetracom-bg.com) (213.145.99.122) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 06:44:09 +0000 Received: (qmail 27918 invoked by uid 1009); 12 Oct 2010 06:43:47 -0000 Received: from 78.90.180.200 by mail.tetracom-bg.com (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.91.2/4648. spamassassin: 3.1.3. perlscan: 1.25-st-qms. Clear:RC:1(78.90.180.200):. Processed in 0.074094 secs); 12 Oct 2010 06:43:47 -0000 X-Antivirus-MAIL.TETRACOM-BG.COM-Mail-From: diman@tetracom.com via mail.tetracom-bg.com X-Antivirus-MAIL.TETRACOM-BG.COM: 1.25-st-qms (Clear:RC:1(78.90.180.200):. Processed in 0.074094 secs Process 27912) Received: from unknown (HELO ?192.168.1.74?) (78.90.180.200) by mail.tetracom-bg.com with SMTP; 12 Oct 2010 06:43:47 -0000 Message-ID: <4CB403BB.2080403@tetracom.com> Date: Tue, 12 Oct 2010 09:44:11 +0300 From: Diman Karagiozov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.11) Gecko/20101007 Thunderbird/3.1.5 MIME-Version: 1.0 To: user@uima.apache.org Subject: UIMA AS - CAS consumer patterns Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi there, I am working on a project that utilizes UIMA Async Scale-out capabilities. There are two client applications that send messages in an "input.queue" and several UIMA aggregate engines that fetch messages from this input queue. What I want to achieve is to send the annotated serialized CAS to an "output.queue" depending on the client application that sent the initial message. In other words - if the message comes from "client A", after processing send it to "output.queue.A"; if it comes from "client B", send it "output.queue.B". This is how I am sending the message to an UIMA worker: final UimaAsynchronousEngine client = ...; final CAS cas = client.getCAS(); cas.reset(); cas.setDocumentLanguage( lang ); cas.setDocumentText( StringUtils.stripNonValidXMLCharacters( text ) ); final String id = client.sendCAS( cas ); Somehow, I have to set the client ID but I do not want to add it in the CAS as annotation. Is there another way to add such information that is later available in the process methods of the primitive engines? If this is possible I can create a new primitive engine (Finalizer) that reads the client ID and implements the messaging router functionality. Are there other pasterns that are more suitable for implementing the above-described scenario? thanks Diman