While requesting channel URI from WNS, the channel uri received is of the form :
https://hk2.notify.windows.com/?token=#
Sometimes instead of hk2 it is seen as db3 in host of the channel URI. On what basis do we get the host of the channel URI? i.e in which cases do we get db3 and hk2 or is it random?
Related
I have API 1 which is defined by int-http:inbound-gateway and has service activator to perform some business logic and sends output on output channel same as reply channel of the inbound gateway(simple flow)
I also have API 2 which is defined in different xml file which also has int-http:inbound-gateway and int-http:outbound-gateway which performs on its own.
Now I want to call API 2 from API 1 but I don’t want to send message of the output channel of first API 1 to API 2, API 1 output channel response if for the end user to consume!
If I use request channel of the API 2 as output channel of API 1, I am thinking I will lose the output of the API 1.
Would you please help how this can be achieved?
Edit :
API 1(there is no need of outbound gateway as this API is doing db operations)
<int-http:inbound-gateway
request-channel="aRequestInputChannel"
reply-channel="aOutputChannel"
supported-methods="POST"
path="/perform"
mapped-request-headers="*"
request-payload-type="com.test.spring.integration.LPRequestPayload">
<int-http:request-mapping consumes="application/json" />
</int-http:inbound-gateway>
<int:service-activator input-channel="aRequestInputChannel" ref="IBAdapterController" method="attachData" output-channel="unRequestChannel"/>
API 2:
<int-http:inbound-gateway
request-channel="unRequestChannel"
reply-channel="unResponseChannel"
supported-methods="POST"
path="/test/unOp"
request-payload-type="com.test.spring.integration.LPRequestPayload"
mapped-request-headers="userId, userName, languageCode, HTTP_REQUEST_HEADERS" >
<int-http:request-mapping consumes="application/json,application/xml" />
<int-http:header name="userId" expression="#requestParams[userId]"/>
</int-http:inbound-gateway>
<int:service-activator input-channel="unRequestChannel" output-channel="unOutputChannel" ref="unAdapterController" method="getUnOpDetails" />
so here if I use output-channel="unRequestChannel" of first api as request channel of API 2,
I am loosing original payload as I am sending http response entity from the controller of the first api. I will need to send LPRequestPayload from first api which is not the requirement. as I am performing some db operation if first api, I need to send its response to the end user.
API 2 is like some mandatory operation that needs to be done after db operation is done.
You need to provide more info about your configuration and use-case.
It is not clear if you are going to call API instead of just replying from the service activator or in addition.
You may also learn that there is no need in the reply-channel in the inbound gateways and output-channel in the last in the flow endpoint. An inbound gateway always populates a replyChannel header and an endpoint (e.g. service activator) without an output-channel is going to produce its reply message exactly into that replyChannel from headers. So, it it might be possible that your requirements are met very easy:
inbound gateway 1 > request channel 1 -> service activator -> request channel 2
inbound gateway 2 > request channel 2 -> outbound gateway 2
With this configuration it doesn't matter if you have that inbound gateway 2 or not, the outbound gateway 2 is always going to reply to the replyChannel header from a request message. Therefore in your case when you initiate request from the inbound gateway 1, the outbound gateway 2 is going to reply back to that one. If you request via inbound gateway 2, then reply will come back exactly into this request initiator. The Reply Address pattern with its power.
Only URLs with a protocol of 'https' are supported for attribute 'callbackUrl'
This error message means exactly what it says: the value that you specify for the callbackUrl property in the Create Webhook request must begin with https:. If the value you specify for the callbackUrl property begins with http: then you'll receive this error message in response. This restriction is in place for security reasons -- i.e., Smartsheet will only send webhook notifications to secure endpoints.
I create a Node.js app with HTTPS protocol. I followed a tutorial from nodejitsu https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server/
But when I sent a request to the server, I git the following error:
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html
When I opened from Chrome, I can only access the page after pressing advanced and proceed to the page.
This is what I filled when generating the certificate:
Country Name (2 letter code) [AU]:ID
State or Province Name (full name) [Some-State]:East Java
Locality Name (eg, city) []:[my city name]
Organization Name (eg, company) [Internet Widgits Pty Ltd]:[some string]
Organizational Unit Name (eg, section) []:[some string]
Common Name (e.g. server FQDN or YOUR name) []:[IP address of the server (Azure server) without port and 'https://']
Email Address []:[my personal yahoo email]
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:[empty]
An optional company name []:[empty]
The app is hosted on Azure server.
How can I fix it?
You are using a Self-Signed certificate which is causing verification failure. You need to get a signed certificate to remove the validation error.
I have changed my reply url in the azure ad tenant application.
I have updated this reply url in the get request for getting the authorization code from azure , along with the client id of the application.
The thing is
I am getting this response
{ "error":"invalid_grant",
"error_description":"AADSTS70002: Error validating credentials. AADSTS50011: The reply address 'newly updated reply url which i send in get request'
does not match the reply address 'old reply url which I changed in AZURE'
provided when requesting Authorization code.
Trace ID: 0e05b301-c7b1-48bd-ab78-ce7c2b12d74d
Correlation ID: 17f5ae64-850d-4767-823c-f0e7ad2c49da
Timestamp: 2016-03-28 12:02:17Z","error_codes":[70002,50011],
"timestamp":"2016-03-28 12:02:17Z",
"trace_id":"0e05b301-c7b1-48bd-ab78-ce7c2b12d74d",
"correlation_id":"17f5ae64-850d-4767-823c-f0e7ad2c49da"
}
I am sure , that there is no issue in the client id , which i pass.
Why is it pointing to the old value ??
I have a specific use case where I need to send account balances of users to their browser and/or mobile device. These balances are of course private but I need to send the balance updates to each connected user when the balance changes, however, I'm concerned about pushing out to 1000s of private channels all at once.
Is there any limitations between Pusher and PubNub for this kind of use case?
EDIT:
I'm specifically looking at https://pusher.com/docs/server_api_guide/interact_rest_api#example-publish-an-event-on-multiple-channels/lang=cs and publishing to multiple channels at once. Would I be able to publish to 100,000 private channels potentially in a single batch?
PubNub Publishing Limits and Security with Realtime Account Balance Notifications
There is no hard limit for publishes per second per channel. PubNub reserves the right to change this limit. Contact support#pubnub.com to confirm your limit.
Publish Realtime Account Balances Securely
So you need to send realtime account balance information to many people securely. When you want to transmit a person's realtime account balance you will need a checklist of security considerations. Since you are transmitting the realtime account balance from a trusted code execution environment, you do not need to implement PKI (Public Key Infrastructure) security. However you do need session token security authorization, user authentication and dual layer encryption.
Session Token Security: PubNub Access Manager will provide the mechanism to allow for Session based user level Access Management.
User Authentication: You will need to authenticate a user by email/password. After successful authentication you will use a grant() API to issue a Session Token for usage with PubNub Access Manager. You will also generate a security string (random long unpredictable key) that will be used in item 3.
Dual Layer Encryption: In addition to TLS, you will also use PubNub AES256 message encryption. You will provide a cipher_key on SDK initialization. In item 2 above, you will need to generate and send the cipher key in addition to the token session key to the user. Both the Cipher Key and Auth Key (token session key) should be long, random and unpredictable.
Good example of a Session Token Key (Auth Key) and a Cipher Key:
cHRiSEZPVkdnd1RqTktNVnB0YkdWS1UxSlRVbXNVMUpyV201U05XUlhSak
Note: The uuid (the user's id) should be treated the same as a cipher key and session token in regards to long and unpredictable.
User Initialization Example for Receiving Realtime Updates
Now you can security connect to PubNub using the following JavaScript example.
<!-- User Initialization Example -->
<script src="https://cdn.pubnub.com/pubnub-3.7.17.min.js"></script>
<script>(function(){
// Init User Connection
var pubnub = PUBNUB({
, subscribe_key : 'sub-c-your-subscribe-key-here'
, auth_key : 'user-session-token-here'
, cipher_key : 'user-cipher-key-here'
, uuid : 'user-id-here'
, ssl : true
});
// Subscribe to a Private User Channel
pubnub.subscribe({
channel : 'user-private-channel-here'
, message : function(message) { console.log(message) }
});
})()</script>
Server Initialization Example for Sending Realtime Updates
Now for your server code in a trusted execution environment, you can publish a message to the end-user client.
// Server Initialization Example
var pubnub = PUBNUB({
publish_key : 'pub-c-your-publish-key-here'
, subscribe_key : 'sub-c-your-subscribe-key-here'
, secret_key : 'sec-c-your-secret-key-here'
, auth_key : 'server-admin-session-token-here'
, cipher_key : 'destination-user-cipher-key-here'
, uuid : 'server-id-here'
, ssl : true
});
// Send Realtime Balance when User's Balance Changes
pubnub.publish({
channel : 'destination-user-private-channel-here'
, message : { "balance" : 10.00 }
});
Note: You must pre-grant access to the user's auth_key before they can subscribe to their user channel on the client device. The server must grant using the grant API.
// Send Realtime Balance when User's Balance Changes
pubnub.grant({
channel : 'destination-user-private-channel-here'
, auth_key : 'user-session-token-here'
, ttl : 1440 // minutes of session time to live
, read : true // user can read-only
, write : false // user can't write
});
Following these guidelines above will allow you to provide modern security to delivering sensitive information to your end-users. Note that we did not cover PKI Public Key Infrastructure which you will need when publishing from untrusted code execution environments. However with your needs you will not need PKI because you are publishing from your server's trusted code.