msghub | Lightweight publisher/subscriber C library based on boost
kandi X-RAY | msghub Summary
kandi X-RAY | msghub Summary
The idea is simple… there are topics, subscribers and publishers. One client create a msghub instance and others are connecting to it. Subscriber specify the topic name of its interest. All clients publish message into a topic and hub distribute messages across all subscribers. Message is a byte array or a string.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of msghub
msghub Key Features
msghub Examples and Code Snippets
Community Discussions
Trending Discussions on msghub
QUESTION
I have a liberty app that connects Bluemix Message Hub. It works fine locally, however it never works when I run the liberty app from Bluemix Liberty. I'm following the example in https://github.com/ibm-messaging/message-hub-samples/tree/master/kafka-java-liberty-sample where you change username/pw in server.xml during runtime.
After some trial and error I realized that when I hardcode my kafka username/pw in server.xml, then BluemixLiberty connects to MsgHub fine. When I "hotswap" the kafka username/pw like in the example, it doesn't work and never connects to kafka (even when I restart the service it doesn't reconnect). I've checked by logging into my service using CF and the sever.xml does have the username/pw correctly swapped.
Is this feature supported in Bluemix Liberty? If not, how am I supposed to properly use vcap-services so I don't hardcode my production user/pw?
...ANSWER
Answered 2017-Jun-22 at 01:14I have just redeployed MessageHub's kafka-java-liberty-sample to Bluemix and checked it works ok.
One reason your own application may not work could be if it reads server.xml
's before the credentials replacement takes place. In the sample, the textual replacement occurs before any JAAS configuration is set.
However, you may follow another, better, approach.
Using Kafka's 0.10.2 client, you do not have to use a global JAAS configuration (a jaas.conf
file in a plain Java app, or a in Liberty's
server.xml
).
You can instead remove both and
sections from
server.xml
and avoid doing any replacement there.
Add to your consumer and producer's Properties
a sasl.jaas.config
property that contains the username and password obtained from VCAP_SERVICES
.
see http://kafka.apache.org/documentation/#security_sasl_plain_clientconfig
e.g. a property like the following with real USERNAME and PASSWORD.
Note that "
and ;
are expected to be there verbatim.
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="USERNAME" password="PASSWORD";
see https://github.com/ibm-messaging/message-hub-samples/pull/17 (we will merge this PR shortly, for now the branch is https://github.com/edoardocomar/message-hub-samples/tree/liberty-fixed-serverxml)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install msghub
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page