Return-Path: Delivered-To: apmail-ws-synapse-dev-archive@www.apache.org Received: (qmail 68739 invoked from network); 27 Jul 2007 13:28:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jul 2007 13:28:47 -0000 Received: (qmail 5771 invoked by uid 500); 27 Jul 2007 13:28:47 -0000 Delivered-To: apmail-ws-synapse-dev-archive@ws.apache.org Received: (qmail 5612 invoked by uid 500); 27 Jul 2007 13:28:45 -0000 Mailing-List: contact synapse-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: synapse-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list synapse-dev@ws.apache.org Received: (qmail 5601 invoked by uid 99); 27 Jul 2007 13:28:45 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 06:28:45 -0700 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: domain of pzfreo@gmail.com designates 64.233.162.239 as permitted sender) Received: from [64.233.162.239] (HELO nz-out-0506.google.com) (64.233.162.239) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 13:28:36 +0000 Received: by nz-out-0506.google.com with SMTP id l1so669547nzf for ; Fri, 27 Jul 2007 06:28:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ayyBhSPjPDQl3KUV6lPi0Kdw7AV1SlOlUTzf9wwFqVzvPb5N9/Ck/GktfRvq3+x9AxQOYksQH/2QkPBo2HaDhwXgHSBmJipZZGc0Fi2sDvKpLVG69OzSdaGRkEzEq0GoC+75G2hpzlW0UOR1SMnKmeRlq0ULL9of/a/8jijAeLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ui5EVsR/EXzBQsXI1hHi/aOMz4ITHIdCeC5YIFDUtRa18kEmLDnLXNTJ5LDCnPa1VSw/+LUFgObaYXE6zpiyuEdUDua138dWuj0643RwqtGcs9RWEN7iIqas0PLMprwD2BSgQQTRLpBl4sp3r0W0oMqMrROckX9SsZM1Un8zFj4= Received: by 10.142.78.10 with SMTP id a10mr175219wfb.1185542893750; Fri, 27 Jul 2007 06:28:13 -0700 (PDT) Received: by 10.142.112.11 with HTTP; Fri, 27 Jul 2007 06:28:13 -0700 (PDT) Message-ID: <88f5d710707270628o76625ee9q76a975b41f0d7952@mail.gmail.com> Date: Fri, 27 Jul 2007 14:28:13 +0100 From: "Paul Fremantle" To: synapse-dev@ws.apache.org Subject: Re: Pointing messages at targets In-Reply-To: <46A9F0D1.4040407@thoughtcraft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <88f5d710707270225y1f14d540k6380134407015f05@mail.gmail.com> <46A9DD6F.3070604@thoughtcraft.com> <88f5d710707270601s7deb79f7kf5187f2669fb6777@mail.gmail.com> <46A9F0D1.4040407@thoughtcraft.com> X-Virus-Checked: Checked by ClamAV on apache.org Yes and No The injectMessage API we offer today is asynchronous, so you can block the mediation waiting for a reply. However, you *can* send a message anywhere. So today, if you do this: mediate(MessageContext sC) { SynapseEnvironment se sC.getSynapseEnvironment(); MessageContext newMessageContext = se.createMessageContext(); newMessageContext.getEnvelope().getBody().addChild(something); newMessageContext.setTo("http://paul.fremantle.org/soap/OneWay"); se.injectMessage(newMessageContext); return true; } This will send the message to "http://paul.fremantle.org/soap/OneWay" if and only if that is how the main sequence in synapse is configured. In other words, if the main sequence doesn't do then this message won't actually go anywhere. If you wanted to block waiting for a service request or be certain the message would go out instantly you'd just have to use the normal Axis2 APIs and Synapse wouldn't help you. Paul On 7/27/07, Glen Daniels wrote: > Paul Fremantle wrote: > > The message is going to end up going somewhere. For example, I want > > the message to go to Amazon s3, but I already have an endpoint > > definition for S3. I could just set the To address to be > > http://s3.amazon.com/whatever. > > > > However, this doesn't take advantage of the endpoint definitions. > > > > Does that make sense? > > Not really. :) But let's forget endpoints for a minute, and imagine > that I have a standard mediation sequence that sends a copy of a message > to a notarization server, gets back a "notarized" ID code, then adds > that code to a header in the message and sends it to its destination. > > Original msg (in pseudo-xml): > >
> http://s3.amazon.com/foo > signed To header and body >
> stuff > > I want to be able to do something like: > > synapseContext.setSynapseTarget("notarizationSeq"); > synapseContext.setMessage(msg); > synapse.send(synapseContext); > > The post-mediation msg that would get sent to Amazon might look like this: > >
> http://s3.amazon.com/foo > signed To header and body > 52 >
> stuff > > Can I do something like that, where the Synapse server doesn't have any > preconfiguration about the actual destinations of the messages? > > --Glen > > > On 7/27/07, Glen Daniels wrote: > >> Hi Paul: > >> > >> Paul Fremantle wrote: > >>> When I inject a new message into Synapse (using the API). > >>> > >>> At the moment messages go into the main sequence. However, it would be > >>> nice to specify a sequence or endpoint for them to be targeted to. > >>> > >>> I'm thinking maybe just setting the To address using a uri scheme > >>> like: "sequence:stockquote" or "endpoint:sq". > >>> > >>> What do you all think? > >> Doesn't this assume that the message itself is "synapse-aware"? What > >> about cases where I want to inject a message that is actually going > >> wsa:To Amazon S3? > >> > >> --Glen > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org > >> For additional commands, e-mail: synapse-dev-help@ws.apache.org > >> > >> > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org > For additional commands, e-mail: synapse-dev-help@ws.apache.org > > -- Paul Fremantle Co-Founder and VP of Technical Sales, WSO2 OASIS WS-RX TC Co-chair blog: http://pzf.fremantle.org paul@wso2.com "Oxygenating the Web Service Platform", www.wso2.com --------------------------------------------------------------------- To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org For additional commands, e-mail: synapse-dev-help@ws.apache.org