vcap-services | Cloud Foundry - the open platform as a service project | REST library
kandi X-RAY | vcap-services Summary
kandi X-RAY | vcap-services Summary
This repository has been deprecated.
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 vcap-services
vcap-services Key Features
vcap-services Examples and Code Snippets
Community Discussions
Trending Discussions on vcap-services
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 vcap-services
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
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