Skip to content

Commit

Permalink
CHKPII fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
karen-rodgers committed Aug 22, 2017
1 parent c02e4b9 commit 0817b06
Show file tree
Hide file tree
Showing 16 changed files with 116 additions and 52 deletions.
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ is some sample output:
{: codeblock}

9. The sample runs indefinitely until you stop it. To stop the process, run a command like the
following: ```Ctrl+C```
following: <code>Ctrl+C</code>


To find out more about running a {{site.data.keyword.messagehub}} sample using Python, see [Python console sample application ![External link icon](../../icons/launch-glyph.svg "External link icon")](https://developer.ibm.com/messaging/2017/02/09/new-message-hub-sample-python-console-application/){:new_window}. You can also find samples
Expand Down
6 changes: 4 additions & 2 deletions messagehub057.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Applications using the Kafka REST API can be subject to rate
limiting for each ApiKey. When this limiting occurs, the API
responds with the following HTTP error:

```429 Too Many Requests```
```429 Too Many Requests
```
{:screen}

If you see this error, wait and submit the request again.
Expand All @@ -83,7 +84,8 @@ request. After the REST API has restarted, you will have to
recreate your Kafka consumer instances. If this is the case, the
REST API returns the following JSON:

```'{"error_code":40403,"message":"Consumer instance not found."}'```
```'{"error_code":40403,"message":"Consumer instance not found."}'
```
{:screen}

## Kafka high-level consumer API
Expand Down
13 changes: 12 additions & 1 deletion messagehub063.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ lastupdated: "2017-05-11"


To connect to {{site.data.keyword.messagehub}}, the
Kafka API uses the ```kafka_brokers_sasl``` credentials, and the ```user``` and ```password``` from
Kafka API uses the
```kafka_brokers_sasl
```
credentials, and the
```
user
```
and

```password
```
from
the [VCAP_SERVICES environment variable](/docs/services/MessageHub/messagehub071.html).

## Connecting and authenticating in an application other than Java
Expand Down
4 changes: 2 additions & 2 deletions messagehub066.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lastupdated: "2016-11-22"
# How to connect and authenticate
{: #rest_connect}

To connect to {{site.data.keyword.messagehub}}, the Kafka REST API uses the ```api_key``` and ```kafka_rest_url```
To connect to {{site.data.keyword.messagehub}}, the Kafka REST API uses the <code>api_key</code> and <code>kafka_rest_url</code>
credentials from the [VCAP_SERVICES environment variable](/docs/services/MessageHub/messagehub071.html).

To authenticate with the {{site.data.keyword.messagehub}} Kafka REST API, you must specify the ```api_key``` in the X-Auth-Token header of your requests.
To authenticate with the {{site.data.keyword.messagehub}} Kafka REST API, you must specify the <code>api_key</code> in the X-Auth-Token header of your requests.
4 changes: 2 additions & 2 deletions messagehub076.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ level of abstraction than the Kafka API. {{site.data.keyword.mql}} enables apps
{:shortdesc}

Apps exchange messages using dynamically created
destinations, which you can hierarchically structure (for example, ```‘/sports/football’```), group using wildcards (for example,
```‘/sports/#’```) and have simple controls for delivery assurance and message expiry.
destinations, which you can hierarchically structure (for example, <code>‘/sports/football’</code>), group using wildcards (for example,
<code>‘/sports/#’</code>) and have simple controls for delivery assurance and message expiry.
This enables you to implement scenarios such as worker offload, event notification, and batch
processing straightforwardly.

Expand Down
8 changes: 4 additions & 4 deletions messagehub078.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To use the API, add a reference to the latest available {{site.data.keyword.mql}
## Java
{: #mql_java_how notoc}

Add the following reference to your ```Maven pom``` file:
Add the following reference to your <code>Maven pom</code> file:

```
<dependency>
Expand All @@ -38,7 +38,7 @@ Add the following reference to your ```Maven pom``` file:
## Node.js
{: #mql_node_how notoc}

Add the following reference to the dependency section of your ```package.json``` file:
Add the following reference to the dependency section of your <code>package.json</code> file:

<pre class="pre"><code>"mqlight" : "1.0.x"</code></pre>
{: codeblock}
Expand All @@ -52,7 +52,7 @@ And add the following require statement to your source file:
## Ruby
{: #mql_ruby_how notoc}

Add the following reference to the ```Gemfile```:
Add the following reference to the <code>Gemfile</code>:

```
gem 'mqlight', '~> 1.0'
Expand All @@ -72,7 +72,7 @@ require ‘mqlight’
## Python
{: #mql_python_how notoc}

Add the following reference to your ```requirements.txt```
Add the following reference to your <code>requirements.txt</code>
file:

```
Expand Down
20 changes: 10 additions & 10 deletions messagehub079.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ lastupdated: "2017-02-13"
# How to connect and authenticate
{: #mql_connect}

To connect an app to the service, the app must use the ```user```,
```password```, and ```mqlight_lookup_url``` details from the [VCAP_SERVICES environment variable](/docs/services/MessageHub/messagehub071.html). Use the following guidance for your chosen language:
To connect an app to the service, the app must use the <code>user</code>,
<code>password</code>, and <code>mqlight_lookup_url</code> details from the [VCAP_SERVICES environment variable](/docs/services/MessageHub/messagehub071.html). Use the following guidance for your chosen language:

**For Java**

If you specify ‘null’ as the endpointService parameter of the create() call, this instructs the
client to read the ```user```, ```password``` and,
```mqlight_lookup_url``` details from VCAP_SERVICES:
client to read the <code>user</code>, <code>password</code> and,
<code>mqlight_lookup_url</code> details from VCAP_SERVICES:

<pre>
<code>NonBlockingClient.create(null, new NonBlockingClientAdapter<Void>() {
Expand All @@ -37,8 +37,8 @@ client to read the ```user```, ```password``` and,

**For Node.js**

Retrieve the ```user```, ```password```, and
```mqlight_lookup_url``` details from VCAP_SERVICES and use them to create the client as
Retrieve the <code>user</code>, <code>password</code>, and
<code>mqlight_lookup_url</code> details from VCAP_SERVICES and use them to create the client as
follows:

<pre>
Expand All @@ -56,8 +56,8 @@ var mqlightClient = mqlight.createClient(opts, function(err) {

**For Ruby**

Retrieve the ```user```, ```password```, and
```mqlight_lookup_url``` details from VCAP_SERVICES and use them to create the client as
Retrieve the <code>user</code>, <code>password</code>, and
<code>mqlight_lookup_url</code> details from VCAP_SERVICES and use them to create the client as
follows:
<pre>
<code>vcap_services = JSON.parse(ENV['VCAP_SERVICES'])
Expand All @@ -75,8 +75,8 @@ set :client, Mqlight::BlockingClient.new(service, opts)

**For Python**

Retrieve the ```user```, ```password```, and
```mqlight_lookup_url``` details from VCAP_SERVICES and use them to create the client as
Retrieve the <code>user</code>, <code>password</code>, and
<code>mqlight_lookup_url</code> details from VCAP_SERVICES and use them to create the client as
follows:
<pre>
<code>vcap_services = json.loads(os.environ.get('VCAP_SERVICES'))
Expand Down
4 changes: 2 additions & 2 deletions messagehub080.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ You can connect existing applications that currently run against either {{site.d
To connect existing apps, complete the following checks:

* Ensure that the app is using the latest available {{site.data.keyword.mql}} API client version for your language.
* Check that the connection details extracted from VCAP_SERVICES reference the ```messagehub``` service type and retrieve the connections user name from the ```credentials.user``` property rather than the ```credentials.username``` property, and retrieve the connection lookup URL from the ```credentials.mqlight_lookup_url``` property rather than the ```credentials.connectionLookupURI``` property. For more information, see [VCAP_SERVICES environment variable](/docs/services/MessageHub/messagehub071.html).
* Check that the connection details extracted from VCAP_SERVICES reference the <code>messagehub</code> service type and retrieve the connections user name from the <code>credentials.user</code> property rather than the <code>credentials.username</code> property, and retrieve the connection lookup URL from the <code>credentials.mqlight_lookup_url</code> property rather than the <code>credentials.connectionLookupURI</code> property. For more information, see [VCAP_SERVICES environment variable](/docs/services/MessageHub/messagehub071.html).

Note that this step is done for you if you use the Java&trade; client and specify 'null' as the endpointService parameter in the create() call, so that the client retrieves the information itself.

* Your app must support TLS v1.2 connections. VCAP_SERVICES no longer contains a ```credentials.nonTLSConnectionLookupURI``` property for creating a non-TLS connection.
* Your app must support TLS v1.2 connections. VCAP_SERVICES no longer contains a <code>credentials.nonTLSConnectionLookupURI</code> property for creating a non-TLS connection.

You should also note the following information:

Expand Down
31 changes: 17 additions & 14 deletions messagehub084.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ If you're using the Java clients, you can now use
the publicly available 0.10.x Kafka clients. You are strongly encouraged to move from 0.9.x to the
latest 0.10.x version (currently 0.10.2.1). Complete the following steps:


1. Delete the {{site.data.keyword.messagehub}} login jar module.
2. Change your ```jaas.conf``` file to the following:
```
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
serviceName="kafka"
username="<your username>"
password="<your password>";
};
```
{: codeblock}
3. Add this line to your consumer and producer properties: ```sasl.mechanism=PLAIN```
<ol>
<li>Delete the {{site.data.keyword.messagehub}} login jar module.</li>
<li>Change your <code>jaas.conf</code> file to the following:

<pre class="pre">
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
serviceName="kafka"
username="&lt;your username&gt;"
password="&lt;your password&gt;";
};
</pre>
{: codeblock}
</li>

<li>Add this line to your consumer and producer properties: <code>sasl.mechanism=PLAIN</code></li>
</ol>
4 changes: 2 additions & 2 deletions messagehub087.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ level of abstraction than the Kafka API. {{site.data.keyword.mql}} enables apps
{:shortdesc}

Apps exchange messages using dynamically created
destinations, which you can hierarchically structure (for example, ```‘/sports/football’```), group using wildcards (for example,
```‘/sports/#’```) and have simple controls for delivery assurance and message expiry.
destinations, which you can hierarchically structure (for example, <code>‘/sports/football’</code>), group using wildcards (for example,
<code>‘/sports/#’<code>) and have simple controls for delivery assurance and message expiry.
This enables you to implement scenarios such as worker offload, event notification, and batch processing straightforwardly.

As well as sending messages between other apps using the {{site.data.keyword.mql}} API, you can also exchange messages with apps that use the Kafka REST or Kafka APIs. Alternatively, you can also use apps on premises with {{site.data.keyword.IBM_notm}} MQ.
Expand Down
2 changes: 1 addition & 1 deletion messagehub099.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lastupdated: "2016-11-22"

To use the API, add a reference to the latest available {{site.data.keyword.mql}} client API for Java as follows:

Add the following reference to your ```Maven pom``` file:
Add the following reference to your <code>Maven pom</code> file:

```
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion messagehub101.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lastupdated: "2016-11-22"

To use the API, add a reference to the latest available {{site.data.keyword.mql}} client API for Python as follows:

Add the following reference to your ```requirements.txt```
Add the following reference to your <code>requirements.txt</code>
file:

```
Expand Down
2 changes: 1 addition & 1 deletion messagehub102.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lastupdated: "2016-11-22"

To use the API, add a reference to the latest available {{site.data.keyword.mql}} client API for Node.js as follows:

Add the following reference to the dependency section of your ```package.json``` file:
Add the following reference to the dependency section of your <code>package.json</code> file:

<pre class="pre"><code>"mqlight" : "1.0.x"</code></pre>
{: codeblock}
Expand Down
2 changes: 1 addition & 1 deletion messagehub103.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lastupdated: "2016-11-22"

To use the API, add a reference to the latest available {{site.data.keyword.mql}} client API for Ruby as follows:

Add the following reference to the ```Gemfile```:
Add the following reference to the <code>Gemfile</code>:

```
gem 'mqlight', '~> 1.0'
Expand Down
62 changes: 55 additions & 7 deletions messagehub104.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2015, 2017
lastupdated: "2017-08-08"
lastupdated: "2017-08-03"

---

Expand All @@ -12,13 +12,61 @@ lastupdated: "2017-08-08"
{:codeblock: .codeblock}
{:pre: .pre}

# Kafka Java client property, APIs and Streams
{: #kafka_using_props}
# Using the Kafka Java client
{: #kafka_using}

## To do: instructions for getting started, with links for more information
{: notoc}

## To do: simple send source and receive source in-line
{: notoc}

## How to use, download, and run the Java Kafka API sample
{: notoc}

The Java&trade; Kafka API sample is an example producer and consumer that is written in Java, which directly uses the Kafka API. You can run this sample locally or in {{site.data.keyword.Bluemix_short}}.

The sample code is in the [message-hub-samples GitHub project ![External link icon](../../icons/launch-glyph.svg "External link icon")](https://github.com/ibm-messaging/message-hub-samples/tree/master/kafka-java-console-sample){:new_window}. Although the sample uses
the Kafka API to send and receive messages, the sample uses the {{site.data.keyword.messagehub}} Administration API to create the topic it sends messages to and receives messages from.

For more information about the setup and running of the sample, see the [README.md ![External link icon](../../icons/launch-glyph.svg "External link icon")](https://github.com/ibm-messaging/message-hub-samples/tree/master/kafka-java-console-sample){:new_window}.

For a detailed walkthrough of how to run the sample, see [Getting started with {{site.data.keyword.messagehub}}](/docs/services/MessageHub/index.html#getting_started_steps).

## How to use, download, and run the Liberty for Java sample
{: #liberty_sample notoc}

The Liberty for Java sample implements a simple application that is deployed onto the Liberty runtime. The application uses the Kafka API for {{site.data.keyword.messagehub}} to produce and consume messages.
The application also serves up a web front end that you can use for administration.

You can find the sample code in the [message-hub-samples GitHub project ![External link icon](../../icons/launch-glyph.svg "External link icon")](https://github.com/ibm-messaging/message-hub-samples/tree/master/kafka-java-liberty-sample){:new_window}.

## How to migrate the Kafka client from 0.9.x to 0.10.x
{: #kafka_migrate notoc}


If you're using the Java clients, you can now use
the publicly available 0.10.x Kafka clients. You are strongly encouraged to move from 0.9.x to the
latest 0.10.x version (currently 0.10.2.1). Complete the following steps:

1. Delete the {{site.data.keyword.messagehub}} login jar module.
2. Change your <code>jaas.conf</code> file to the following:
```
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
serviceName="kafka"
username="<your username>"
password="<your password>";
};
```
{: codeblock}
3. Add this line to your consumer and producer properties: <code>sasl.mechanism=PLAIN</code>
## Using the sasl.jaas.config property
{: #sasl_prop notoc}
If you're using a Kafka client at 0.10.2.1 or later, you can use the ```sasl.jaas.config``` property for client configuration instead of a JAAS file. To connect to {{site.data.keyword.messagehub}}, set ```sasl.jaas.config``` as follows:
If you're using a Kafka client at 0.10.2.1 or later, you can use the <code>sasl.jaas.config</code> property for client configuration instead of a JAAS file. To connect to {{site.data.keyword.messagehub}}, set <code>sasl.jaas.config</code> as follows:
<pre>
<code> sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
username="USERNAME" \
Expand All @@ -28,7 +76,7 @@ If you're using a Kafka client at 0.10.2.1 or later, you can use the ```sasl.jaa
where USERNAME and PASSWORD are the values from your {{site.data.keyword.messagehub}} **Service Credentials** tab in {{site.data.keyword.Bluemix_notm}}.
If you use ```sasl.jaas.config```, clients running in the same JVM can use different credentials. For more information, see
If you use <code>sasl.jaas.config</code>, clients running in the same JVM can use different credentials. For more information, see
[Configuring Kafka clients ![External link icon](../../icons/launch-glyph.svg "External link icon")](http://kafka.apache.org/documentation/#security_sasl_plain_clientconfig){:new_window}
## APIs for topic administration
Expand All @@ -51,7 +99,7 @@ If the cleanup policy is <code>compact</code> only, we automatically add <code>d
## Support for Kafka Streams
{: #kafka_streams notoc}
Starting from the Streams library 0.10.2.0, the topic APIs now work with {{site.data.keyword.messagehub}} with no setup required. Specify your SASL credentials using ```sasl.jaas.config``` or a JAAS file and set ```replication.factor``` to 3.
Starting from the Streams library 0.10.2.0, the topic APIs now work with {{site.data.keyword.messagehub}} with no setup required. Specify your SASL credentials using <code>sasl.jaas.config</code> or a JAAS file and set <code>replication.factor</code> to 3.
For example:
Expand All @@ -71,6 +119,6 @@ For example:
where BOOTSTRAP_SERVERS, USERNAME, and PASSWORD are the values from your {{site.data.keyword.messagehub}} **Service Credentials** tab in
{{site.data.keyword.Bluemix_notm}}.
<!-- PRODUCTION ONLY VERSION:
<!--
new topic that includes content from existing topics about samples and migration
-->
2 changes: 1 addition & 1 deletion messagehub106.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The choice between using a Kafka client or the {{site.data.keyword.mql}} API dep
want to build:

* With Kafka, you use a small number of topics and can have multiple partitions for each topic for additional scalability. You can share messages among consumers by using consumer groups, but each consumer must be able to keep up with the rate of messages for the partitions assigned to it.
* With the {{site.data.keyword.mql}} API, you can use a much larger number of topics and the topic names are hierarchical (for example: ```‘/sports/football’``` and ```‘/sports/tiddlywinks’```). Sharing messages among consumers is much simpler.
* With the {{site.data.keyword.mql}} API, you can use a much larger number of topics and the topic names are hierarchical (for example: <code>‘/sports/football’</code> and <code>‘/sports/tiddlywinks’</code>). Sharing messages among consumers is much simpler.

The topics in the {{site.data.keyword.mql}} API are not the same
as Kafka topics. Instead, the {{site.data.keyword.mql}} API uses a
Expand Down

0 comments on commit 0817b06

Please sign in to comment.