* Fix failed subscription handling in ws adapter
Fix unsubscribing bug in ws adapter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add subscription fail and publish fail test cases
Update mock implementation to receive publish error in order to
support these test cases.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update mainflux version to 0.2.3
Update project version and load tests version to 0.2.3.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update version endpoint response format
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update content-type header in load tests
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove charset from content type header in documentation
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
Ramove unnecessary checks from decodeList.
Cover some edge cases and fix decodeList to always return same error.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Add initial load tests
Add initial load tests for client creation and message publishing.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Make load tests executable as stand-alone application
Move code from test to main. Make code runnable with sbt run command.
Remove unnecessary config files.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add native packager support
Add native packager plugin. Update sbt config to support native
packager. Update paths in Engine.scala.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Move files back to test folder and remove native packager support
Remove nativa packager plugin. Add gatling plugin and move files to
test folder where they belong. Read vars from JAVA_OPTS instead of
environment variables.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add readme file for load tests
Add readme file for load tests with usage instructions.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add number of requests per second as test parameter
Add number of requests per second as parameter. Update read me according
to this addition.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add load test section in docs
Create documentation skeleton for load tests.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Reformat logger config file
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update documentation skeleton
Move results section to scenarios. Move test environment to intro.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Align test version with mainflux version
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update mainflux version to 0.2.2
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add pagination to clients and channels endpoints
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Refactor code
Change method signature and rename Bulk methods back to All.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Rename transport_test.go to endpoint_test.go
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix manager tests to support pagination
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Add default offset and limit support
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Update docs
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Update tests to support pagination
- Move maxLimitSize checking to request validation.
- Add tests to support pagination.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix handling query params for pagination
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix empty result set
Return empty results if invalid offset and limit is passed to channel and client repository.
Update tests accordingly.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Update manager API docs
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Fix response to invalid limit query param
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Remove offset and limmit checks in repository methods
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
New targets will allow Makefile to be used as primary option for
releasing docker containers, both as 'latest' and versioned.
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
* Add websocket adapter
Add websocket adapter with basic logging and metrics middleware.
Add publish and subscribe to NATS subjects using websocket.
Add websocket handshake authorization over mainflux manager.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add test for websocket publish
Add test for websocket adapter's publish method. Add dependecy
injected logger to adapter. Remove unnecessary manager client
dependency from adapter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add websocket library in dependencies
Add gorilla/websocket dependency in dep toml and lock file.
Add dependency in vendor dir.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add direct websocket connection
Add direct websocket connection. While messages are still beeing
published over NATS, they are not received over src.ws subject
in WebSocket adapter. Instead messages are sent directly over
websocket connection.
Add swagger file for WebSocket handshake endpoint. Update ReadMe
to reference new swagger file.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactore websocket adapter code
Extract listen part from handshake. Update WebSocket adapter code.
Fix subscribe to NATS subject, so that it is independent from other
adapters. Remove message base64 encoding from response..
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove connection management from websocket adapter
Align notion of channel with NATS topic. Remove connection
management from adapter logic. Add log messages to adapter's
transport layer.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update NATS subjects and add subscriber interface
Update NATS subject name to channel.<channel_id>. Add and implement
subscriber interface. Implement subscriber interface in adapter.
Update readme to use new make <service_name> command. Refactor code.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add basic tests for broadcast and subscribe
Improve mock implementation of NATS pubsub. Add multiple basic test
cases for broadcast and subscribe methods. Add logging for subscribe.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add listen method test
Add listen method test and refactor existing tests. Refactor listen
method in adapter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Move broadcast method to message broker interface
Refactor broadcast method to receive send message callback and message
that needs to be sent. Update tests accordingly.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update pubsub API
Remove listen method from public API. Move listen call to subscribe
implementation. Update domain pubsub API in project root.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add connection error handlers to adapter API
Update publish and subscribe API to receive connection error handler.
Update tests accordingly. Handle NATS connection error.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update logs
Replace go-kit logger with custom mainflux logger. Update log messages
where needed..
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactor web socket adapter
Remove MessagePubSub interface. Remove unnecessary callbacks. Add
channels to web socket adapter implementation.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add API layer tests
Update existing tests and add API layer tests.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update docs with web socket related data
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactor web socket adapter
Update subscription struct, and refactor listen and broadcast methods.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add version and metrics endpoint to ws adapter
Update version to 0.2.0.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Fix race condition bug in ws adapter test
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Rename listen to broadcast and broadcast to listen
Switch names between listen and broadcast methods. Move channel
structure to service.go.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
Update documentation with example requests and responses in accordance
with new API changes. Add detailed flow explanation. Update readme with
valid snippet.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Copy basic docs contents to the main repo
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
* Include licensing and contributing info to docs
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
* Create documentation skeleton
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
* Fix connection request validation and EOF error handling
Fix validation of connection and client id in connection request.
Fix EOF error handling by returning HTTP status Bad Request.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add manager API tests and update swagger
Implement unit tests for every manager API endpoint. Update client
and connection mock implementations by switching to UUIDs. Update
swagger file with correct status codes.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add content type check and update documentation
Add content type check in implementation and update documentation
accordingly. Refactor tests and add empty content type test cases.
Add code coverage badge to readme.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add logger interface and go-kit logger implementation
Add wrapper logger interface and wrap go-kit logger in it. Add
tests for info, warn, error and log methods. Add log filtering by
level.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactor logger and replace go-kit logger with wrapper
Replace go-kit logger from services with logger wrapper. Refactor
code in logger wrapper. Remove unnecessary subpackage, methods and
log levels.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Expose metrics from normalizer service
Add service interface in order to expose method to be monitored.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* Refactor normalizer
Add metrics to normalizer service without exporting its internals.
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
Fix normalizer output queue by changing subject to normalized.
Version updated from 0.1.0 to 0.1.1.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>