Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed May 3, 2018
1 parent ebf5adc commit d86ed69
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions README.md
Expand Up @@ -123,35 +123,6 @@ const msg = new Message('TP_NAME', // topic
const sendResult = yield ctx.ons.send(msg);
```

## Dynamic Create Consumer and Producer

You can dynamic create comsumer or producer by your self.

```js
// app.js

module.exports = app => {
app.beforeStart(function* () {
// dynamic create a consumer, and subscribe topics use the subscriber in the second argument
yield app.createConsumer({
consumerGroup: 'consumerGroup',
topics: [
'TEST_TOPIC',
],
}, {
TEST_TOPIC: require('./ops/TEST_TOPIC'), // the subscriber for TEST_TOPIC
});
// dynamic create a producer
yield app.createProducer({
producerGroup: config.producerGroup,
topics: [
'TEST_TOPIC',
],
});
});
};
```

## Questions & Suggestions

Please open an issue [here](https://github.com/eggjs/egg/issues).
Expand Down

0 comments on commit d86ed69

Please sign in to comment.