One of the lessons I learnt from WSDL is not to force users to define and
name things unless they need to reuse it. So forcing me to create a named
config is annoying IMO. I'm +1 for being able to call <twitter.config> once
and forget about it for the current MC - it has to work that way. I think
that's enough to handle Samisa's usecase nicely too (unless I've
misunderstood).

So, +1 for being able to name the config and use it, but -1 on forcing that.

Sanjiva.


On Wed, Jul 24, 2013 at 5:24 PM, Kasun Indrasiri <[email protected]> wrote:

>
> - How about not having twiiter.config element and instead we define that
> as a local entry as mentioned above. Then we only refer them when invoking
> an operation. (Virtually all operations have 'conf' as an optional
> parameter and if not specified it will use the existing values from the
> context)
>
>  <twitter.updateStatus conf="sanjiva_twitter_conf">Hello, World (from
> Sanjiva)</twitter.updateStatus>
> <twitter.updateStatus >Hello, World 2 (from
> Sanjiva)</twitter.updateStatus> <!-- Still use the same credentials -->
>
>  <twitter.updateStatus conf="samisa_twitter_conf">Hello, World (from
> Samisa)</twitter.updateStatus>
>
>
> On Wed, Jul 24, 2013 at 4:51 PM, Sanjiva Weerawarana <[email protected]>wrote:
>
>> On Wed, Jul 24, 2013 at 4:14 PM, Samisa Abeysinghe <[email protected]>wrote:
>>
>>> OK, so, it should be at proxy level. If there are two twitter connectors
>>> for a proxy, they will be defined as twitterYou and twitterMe within the
>>> proxy scope. And we can re-use them in sequences as we wish.
>>>
>>
>> I don't think I understand what that means ... connector "instances" are
>> not named - so what does twitterYou an twitterMe mean when there's no
>> config separated? If there's no config reference, there's only one config
>> in scope .. whatever was defined earlier in the sequence. So there's only
>> one around.
>>
>> If you want to do a status update as "you" vs "me" then you'd need to
>> reenter <twitter.config> with the right creds and then use it (see below).
>>
>>  Dushan why are the properties named synapse.runtime.oauth.accessToken??
>>>> There are two problems with this:
>>>> - this has NOTHING to do with Synapse so its wrong to
>>>> synapse.runtime.*.
>>>> - second, MORE IMPORTANTLY, many mediators will have an
>>>> oauth.accessToken property! So this will not work .. it needs to be
>>>> twitter.oauth.accessToken (which is what I said the first time IIRC).
>>>>
>>>
>> I made a mistake here .. the property names should be possible to be
>> arbitrary - otherwise we can't do Samisa's scenario above of tweeting as X
>> and tweeting as Y:
>>
>> <sequence>
>>     <!-- tweet as sanjiva -->
>>     <twitter.config>
>>          <oauth.consumerSecret>{vault-lookup('*sanjiva*
>> .twitter.oauth.consumerSecret')}</oauth.consumerSecret>
>>
>>  
>> <oauth.accessTokenSecret>{vault-lookup('sanjiva.twitter.outh.accessTokenSecret')}</oauth.accessTokenSecret>
>>
>>  
>> <oauth.accessToken>{vault-lookup('sanjiva.twitter.oauth.accessToken')}</oauth.accessToken>
>>
>>  
>> <oauth.consumerKey>{vault-lookup('sanjiva.twitter.oauth.consumerKey')}</oauth.consumerKey>
>>     </twitter.config>
>>     <twitter.updateStatus>Hello, World (from
>> Sanjiva)</twitter.updateStatus>
>>
>>     <!-- tweet as samisa -->
>>     <twitter.config>
>>          <oauth.consumerSecret>{vault-lookup('*samisa*
>> .twitter.oauth.consumerSecret')}</oauth.consumerSecret>
>>
>>  
>> <oauth.accessTokenSecret>{vault-lookup('saisa.twitter.outh.accessTokenSecret')}</oauth.accessTokenSecret>
>>
>>  
>> <oauth.accessToken>{vault-lookup('samisa.twitter.oauth.accessToken')}</oauth.accessToken>
>>
>>  
>> <oauth.consumerKey>{vault-lookup('samisa.twitter.oauth.consumerKey')}</oauth.consumerKey>
>>     </twitter.config>
>>     <twitter.updateStatus>Hello, World (from
>> Samisa)</twitter.updateStatus>
>> </sequence>
>>
>> Now someone just has to get the right info into the vault.
>>
>> Sanjiva.
>> --
>> Sanjiva Weerawarana, Ph.D.
>> Founder, Chairman & CEO; WSO2, Inc.;  http://wso2.com/
>> email: [email protected]; phone: +94 11 763 9614; cell: +94 77 787 6880 | +1
>> 650 265 8311
>> blog: http://sanjiva.weerawarana.org/
>>
>> Lean . Enterprise . Middleware
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Kasun Indrasiri
> Software Architect
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
> cell: +94 71 536 4128
> Blog : http://kasunpanorama.blogspot.com/
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.;  http://wso2.com/
email: [email protected]; phone: +94 11 763 9614; cell: +94 77 787 6880 | +1
650 265 8311
blog: http://sanjiva.weerawarana.org/

Lean . Enterprise . Middleware
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to