calling Event Hub with WSO2

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

calling Event Hub with WSO2

Aman Singh
Hi team,

I have created an Event Hub in Azure. To call the Event Hub we use simple GET request as mentioned in Event Hub docs. We also need an "Bearer Token" {authentication key}, to call the request with POSTMAN.

If I am calling that Event Hub via WSO2 ESB, using proxy service and attaching a "HTTP Endpoint" inside a SEND mediator, where my HTTP Endpoint contain the 'request' to call Event Hub. Where and how can I use/attach the "bearer token" in my WSO2 ESB.

Any help would be appreciated.

Thank you,
Aman


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: calling Event Hub with WSO2

Shakila Sivagnanarajah
Hi Aman,

Please set the following property before the send or call mediator in your proxy service configuration.

<property name="accessToken" value="<ACCESS_TOKEN>"/>
<property name="Authorization" expression="fn:concat('Bearer  ', $ctx:accessToken)" scope="transport"/>

Note: Replace the <ACCESS_TOKEN> by the actual token.

Thanks

On Thu, Jul 26, 2018 at 2:13 PM, Aman Singh <[hidden email]> wrote:
Hi team,

I have created an Event Hub in Azure. To call the Event Hub we use simple GET request as mentioned in Event Hub docs. We also need an "Bearer Token" {authentication key}, to call the request with POSTMAN.

If I am calling that Event Hub via WSO2 ESB, using proxy service and attaching a "HTTP Endpoint" inside a SEND mediator, where my HTTP Endpoint contain the 'request' to call Event Hub. Where and how can I use/attach the "bearer token" in my WSO2 ESB.

Any help would be appreciated.

Thank you,
Aman


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Shakila Sasikaran
Software Engineer
Mobile :+94 (0) 77 526 6848
WSO2, Inc. 
lean . enterprise . middleware

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: calling Event Hub with WSO2

Shakila Sivagnanarajah
Hi Aman,

Please confirm whether you put the real value of the token in the value attribute of property mediator as below.

<property name="accessToken" scope="default" type="STRING" value="qwMq12371BndncuP!HJk2387PkDggsjakbjcd1ha4_kHJgfnj_JsGwWub9z"/>

Thanks

On Tue, Jul 31, 2018 at 9:49 AM, Aman Singh <[hidden email]> wrote:
Dear Shakila,

I tried it in my WSO2, but when I am running my proxy service it is saying "This service has been secured with UTOverTransport".

Below is my sample code:-

<?xml version="1.0" encoding="UTF-8"?>
<proxy name="AzureProxy1" startOnLoad="true" transports="http https" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <log description="LOG" level="custom">
                <property name="property name" value="=================="/>
            </log>
            <property name="accessToken" scope="default" type="STRING" value="{access_token_value}"/>
            <property description="OAuth Property" expression="fn:concat('Bearer  ', $ctx:accessToken)" name="Authorization" scope="transport" type="STRING"/>
            <send>
                <endpoint key="azureEP1"/>
            </send>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </target>
</proxy>


And my HTTP Endpoint is :-


Thank you,
Aman.

On Thu, Jul 26, 2018 at 2:22 PM, Aman Singh <[hidden email]> wrote:
Thank you Shakila, will try it.

Thank you,
Aman.

On Thu, 26 Jul 2018, 14:20 Shakila Sasikaran, <[hidden email]> wrote:
Hi Aman,

Please set the following property before the send or call mediator in your proxy service configuration.

<property name="accessToken" value="<ACCESS_TOKEN>"/>
<property name="Authorization" expression="fn:concat('Bearer  ', $ctx:accessToken)" scope="transport"/>

Note: Replace the <ACCESS_TOKEN> by the actual token.

Thanks

On Thu, Jul 26, 2018 at 2:13 PM, Aman Singh <[hidden email]> wrote:
Hi team,

I have created an Event Hub in Azure. To call the Event Hub we use simple GET request as mentioned in Event Hub docs. We also need an "Bearer Token" {authentication key}, to call the request with POSTMAN.

If I am calling that Event Hub via WSO2 ESB, using proxy service and attaching a "HTTP Endpoint" inside a SEND mediator, where my HTTP Endpoint contain the 'request' to call Event Hub. Where and how can I use/attach the "bearer token" in my WSO2 ESB.

Any help would be appreciated.

Thank you,
Aman


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Shakila Sasikaran
Software Engineer
Mobile :+94 (0) 77 526 6848
WSO2, Inc. 
lean . enterprise . middleware




--
Shakila Sasikaran
Software Engineer
Mobile :+94 (0) 77 526 6848
WSO2, Inc. 
lean . enterprise . middleware

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev