Hemera:用于NATS消息系统的Node.js微服务工具包
用于NATS消息系统的Node.js微服务工具包,可以编写可靠和容错的微服务nats-hemera@6.0.0
StarpTech released this
- Upgrade to Pino 5 logger. https://github.com/pinojs/pino/releases/tag/v5.0.0
- Don't check custom logger instance with Joi because it produces side-effects and causes an error. #221
- Don't handle errors as success payload in case of:
Promise.reject('success')
cb('success', null)
Breaking changes
- PrettyLog is disabled by default. You have to install
pino-pretty
in order to archive the same result. More informations here - Only native error objects can be responded. In case of an invalid error, the server will log an error and the client will timeout.
nats-hemera@5.8.9
StarpTech released this
Fixed
- Don't swallow
onServerPreResponse
error it has precedence over other extension errors.
Miscellaneous
- Add more test
- Add example for server extensions
nats-hemera@5.8.8
StarpTech released this
- #220 Set metadata context correctly when subsequent calls use different values for the same metadata properties'
nats-hemera@5.8.5
StarpTech released this
- Validate typescript types on ci and test hook
- Improve typescript types
nats-hemera@5.8.0
StarpTech released this
- Add
pattern
,transport
properties to client request object. - Remove getter and setters
- Update docs and examples.
nats-hemera@5.7.1
StarpTech released this
Fixed
- Hemera should emit an error when nats connection was closed so process watchers can restart it accordingly.
nats-hemera@5.6.0
StarpTech released this
- Fix logging message
- Add logs for server and client hooks (Request- started, received, responded, completed)
- Improve knabe plugin
nats-hemera@5.5.0
StarpTech released this
- Improved request logs.
- New option
traceLog
to attach tracing information to each log.
nats-hemera@5.4.9
StarpTech released this
- Remove
this.request$.parentId
because it's duplicated. The parent relationship is tracked inthis.trace$.parentSpanId
- Update docs
- Improve tests
nats-hemera@5.4.8
StarpTech released this
nats-hemera@5.4.7
StarpTech released this
Avoid to create separate promise in catch case when callback-style is used. Perf gains ~10%.
nats-hemera@5.4.6
StarpTech released this
- Update deps
- Use strict mode in
index.js
nats-hemera@5.4.5
StarpTech released this
- improve TS types
nats-hemera@5.4.2
StarpTech released this
Remove redundant error log #207
nats-hemera@5.4.0
StarpTech released this
- Allow to pass a stream to default logger Pino
- Refactor logger configuration
- Improve tests
nats-hemera@5.3.0
StarpTech released this
- Refactor plugin dependencies
- Add decorator dependencies
- Simplify hemera-plugin
PR: #200
nats-hemera@5.1.2
StarpTech released this
- Remove
expectedMessages$
fromAdd
object. - Don't assign default inbox queue to
Add
object.
nats-hemera@5.1.1
StarpTech released this
Fixed regression of maxMessages$: -1
nats-hemera@5.0.4
StarpTech released this
Update pino dependency
nats-hemera@5.0.3
StarpTech released this
Refactor shutdown routine with avvio
nats-hemera@5.0.1
StarpTech released this
Improvements
- Improve extension and middleware performance by using a self-written iterator.
- Improve error messages to be more expressive.
Bug fixes
Async/Await
Client and Server extensions should not be fulfilled when a native error object was returned.
nats-hemera@5.0.0
StarpTech released this
- Implement not found pattern
Other changes
nats-hemera@5.0.0-rc.7
StarpTech released this
- Ship typescript typings for
nats-hemera
- Return
this
in setter functions innats-hemera
nats-hemera@5.0.0-rc.4
StarpTech released this
- Rename hemera error
BusinessError
toResponseError
- Update docs
nats-hemera@5.0.0-rc.1
StarpTech released this
I'm really happy to announce the new Hemera 5 release!
This release is a ground-breaking refactoring of the core. The goal was to simplify but also make the lifecycle of extensions and middlwares more predictable.
In summary:
- Refactor extension lifecycle and handling
- Refactor plugin management
- Simplify payload validator and codec interface
- Brand new Documentation with https://docusaurus.io/
Breaking changes:
- Removed
Reply.end()
- Removed
hemera.root
property - Removed
Hemera.reply()
in favor ofhemera.reply.next()
to send multiple responses in a row - Removed configuration properties
crashOnFatal
,shouldCrash
. The developer is responsible to catch these errors - Removed
CodecPipeline
- Removed
encoder
,decoder
. We provide setter functions for client and server encoding - Remove support to register multiple plugins at once with
hemera.use
- Remove
plugin$
, plugins property, removehemera.setOption()
,hemera.setConfig()
methods - Remove functionality to to send a response inside
serverPreResponse
. This was confusing because the payload is already set at this point - Load plugins only on
hemera.ready()
not whenhemera.use()
is called - We break the support of simple return values in
add
ormiddlewares
without the use of callback or promises
New features:
- Implement schemaCompiler to archive better abstraction for payload validators
- Support for async schemaCompiler
- Encapsulate extensions, codec and schemaCompiler
- Provide setter functions for client and server encoding
Modified packages
hemera-joi
Remove post validation- Remove support for
hemera-nsq
andhemera-controlplane
hemera-plugin
you can skip the creation of a plugin scope withscoped:false
Bug fixes
- Fixed issue in add middleware. Passed errors didn't lead to cancellation
nats-hemera@4.0.0
StarpTech released this
Breaking changes
- Use of callback-style with
act(...)
won't return a promise anymore ratherundefined
- Use of promise-style with
act(...)
will return to a fulfilled promise a context object with two propertiesdata
andcontext
. On a rejection, only the error is returned.data
message responsecontext
hemera instance with the right meta$, context$ and trace$ informations.
Migration Guide
Don't mix callback and promise style and work in case of promise with the result object
Before
const result = await hemera.act({
topic: "math",
cmd: "add"
}, async function (err, resp) {
// code ...
})
After with promise
const result = await hemera.act({
topic: "math",
cmd: "add"
})
// code ...
result.data
result.context
After with callback
hemera.act({
topic: "math",
cmd: "add"
}, function (err, resp) {
// code ...
})
hemera-jaeger@2.0.0
StarpTech released this
- Support of custom parent span via
context$
- Remove hemera version from span tags
- Use pattern as span operation name
- Add
HEMERA_OP_TYPE
,HEMERA_ACT_EXPECTEDMSG
andHEMERA_CONTEXT
tags
nats-hemera@3.5.0
StarpTech released this
- Implement
onAdd
extensions #188 - Expose
matchedAction
which represent the matched action behind the pattern
nats-hemera@3.2.0
StarpTech released this
Add promise support for hemera.ready()
when no callback is passed.
nats-hemera@3.1.9
StarpTech released this
- Upgrade nats-hemera dependencies
- Upgrade dev-dependencies from Repository
nats-hemera@3.1.8
StarpTech released this
Upgrade avvio to v5.1
Watchers:35 |
Star:626 |
Fork:63 |
创建时间: 2016-11-16 05:13:42 |
最后Commits: 7天前 |
ca07311
Hooks refactoring #236