kubemq-io / kubemq-go Goto Github PK
View Code? Open in Web Editor NEWgo library for kubemq server
License: Apache License 2.0
go library for kubemq server
License: Apache License 2.0
Hi, I was wondering why there is no client ID in QueryReceive and CommandReceive, I kinda need access to Client IDs
The stream send
function pushes the message into the eventCh
and it's processed in another goroutine (
kubemq-go/events_store_client.go
Line 67 in 4b4e96d
Is there any way (except time sleep) to wait for send
goroutine before shutting down the application?
Hi,
We are getting an error when downloading the kubemq-io/kubemq-go repo.
$ go get -u github.com/kubemq-io/kubemq-go
go: finding github.com/kubemq-io/kubemq v1.5.1
go: github.com/kubemq-io/[email protected]: unknown revision v1.5.1
go: error loading module requirements
We realize this line in go.mod file causes the error.
github.com/kubemq-io/kubemq v1.5.1
This should be "workerB" instead of workerA
Thanks for the wonderful library, appreciate it !
When sending query response (via GRPC protocol) with some tags attached, those tags does not appear on the query receivers response.
How to reproduce: I did a few modifications to query example code
To the query response
kubemq-go/examples/rpc/query/main.go
Line 43 in d31f5a6
err := client.NewResponse().
SetRequestId(query.Id).
SetResponseTo(query.ResponseTo).
SetExecutedAt(time.Now()).
SetMetadata("this is a response").
SetBody([]byte("got your query, you are good to go")).
SetTags(map[string]string{"key0":"val0","key1":"val1"}).
Send(ctx)
at the end of main function add tags output:
fmt.Println("Response Tags Received:",response.Tags)
Then I did change protocol:
kubemq-go/examples/rpc/query/main.go
Line 15 in d31f5a6
kubemq.WithAddress("localhost", 50000),
// kubemq.WithUri("http://localhost:9090"),
kubemq.WithClientId("test-query-client-id"),
kubemq.WithTransportType(kubemq.TransportTypeGRPC))
// kubemq.WithTransportType(kubemq.TransportTypeRest))
after that running this code shows nothing tags in response:
Response Tags Received: map[]
When switch back to the rest protocol:
// kubemq.WithAddress("localhost", 50000),
kubemq.WithUri("http://localhost:9090"),
kubemq.WithClientId("test-query-client-id"),
// kubemq.WithTransportType(kubemq.TransportTypeGRPC))
kubemq.WithTransportType(kubemq.TransportTypeRest))
It start to show tags in response again. Here https://github.com/Aidamir/kubemq-go/tree/master/examples/rpc - I prepared examples illustrating the issue. There is 2 directories query-tags-rest, query-tags-grpc. Please explain me, why tags are not sending when using grpc? May be there is some protocol restrictions which I was missing from documentation? I am using 1.3.2 client and 1.7.3 server backend versions.
Note: I am able to see the response tags on the backend, while running request though grpc:
~/prj/userservice/kubemq$ kubemqctl queries attach testing_query_channel
Adding 'testing_query_channel' to attach list
[queries] [testing_query_channel] kubemq-0f51a6673f21 Server connected.
[queries] [testing_query_channel] { "Kind": "request", "ID": "some-query-id", "Channel": "testing_query_channel", "ReplyChannel": "_INBOX.m1exnq77kXwrttaEudUge4.DYgcQrUG", "Metadata": "some-metadata", "Body": "hello kubemq - sending a query, please reply", "Timeout": 0, "CacheKey": "", "CacheTTL": 0, "ClientID": "test-query-client-id", "Tags": ""}
[queries] [testing_query_channel] { "Kind": "response", "RequestID": "some-query-id", "ReplyChannel": "", "Metadata": "this is a response", "Body": "got your query, you are good to go", "CacheHit": false, "ClientID": "test-query-client-id", "Tags": "key0=val0\nkey1=val1\n"}
Thanks.
Hello. I was discovered the clientId option is always empty on the received event. However, the value is correctly set on the sender side. The following is the ouput of the real-time example, modified for isllustrating issue.
~/prj/kubemq-go/examples/pubsub/real-time$ ./real-time
2020/05/29 09:31:58
Before sending ClientId:test-event-grpc-client
2020/05/29 09:31:58 Receiver B - Event Received:
EventID: some-id
Channel: testing_event_channel
Metadata: some-metadata
Body: hello kubemq - sending single event
ClientId:
2020/05/29 09:31:58 Receiver A - Event Received:
EventID: some-id
Channel: testing_event_channel
Metadata: some-metadata
Body: hello kubemq - sending single event
2020/05/29 09:31:58 Receiver B - Event Received:
EventID: some-event-id
Channel: testing_event_channel
Metadata: some-metadata
Body: hello kubemq - sending stream event
ClientId:
2020/05/29 09:31:58 Receiver A - Event Received:
EventID: some-event-id
Channel: testing_event_channel
Metadata: some-metadata
Body: hello kubemq - sending stream event
It would be also greate to be able to get clientId from the *kubemq.Client. I have not found a way how to get it currently.
Thanks.
Hi, i wanna use Ping() before using QueuesStream which is not available in QueuesClient. Can you please add method bellow or Ping() on QueuesClient? At current state, i'm not allowed to create QueuesClient outside of package.
// NewQueuesClient - create a new QueuesClient from client directly
func (c *Client) NewQueuesClient() *QueuesClient {
return &QueuesClient{client: c}
}
Thanks.
Hi,
I'm getting this error when I try to subscribe to a channel wildcard (event store) foo.*
rpc error: code = Internal desc = Error 107: invalid channel value, no wildcards are allowed
Are wildcards not allowed in event store subscription?
When trying to install the Go client library on OSX Mojave I get the following:
# github.com/kubemq-io/kubemq-go
../../kubemq-io/kubemq-go/trace.go:18:3: cannot use nil as type "go.opencensus.io/trace".Annotation in field value
Hi,
Just today, we are getting an error when downloading the kubemq-io/kubemq-go repo.
It was all working fine yesterday.
$ go get -u github.com/kubemq-io/kubemq-go
# github.com/kubemq-io/kubemq-go
../github.com/kubemq-io/kubemq-go/rest.go:142:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:165:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:273:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:397:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:467:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:535:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:563:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:598:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:632:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:652:12: undefined: resty.R
../github.com/kubemq-io/kubemq-go/rest.go:652:12: too many errors
Hi,
I occasionally get the following error:
rpc error: code = Unknown desc = stan: connect request timeout (possibly wrong cluster ID?)
Until now, I haven't quite found a pattern for this error to occur, but it is thrown after calling queuesClient.Send:
// this code is called in main.go, closing of client connection is deferred
queuesClient, err := kubemq.NewQueuesStreamClient(ctx,
kubemq.WithAddress(host, grpcPort),
kubemq.WithClientId(clientId),
kubemq.WithTransportType(kubemq.TransportTypeGRPC))
if err != nil {
return nil, err
}
...
// this code is called when a specific event occurs and errors occasionally.
res, err := queuesClient.Send(ctx, kubemq.NewQueueMessage().
SetChannel(channel).SetMetadata(msg.Metadata).SetBody(msg.Body).SetTags(msg.Tags))
if err != nil {
logger.GetLogger(ctx).Error().Caller().Err(err).Send()
return nil, err
}
...
I have multiple services running in a minikube cluster in their own namespace and KubeMQ deployed with Helm according to the docs. The services are deployed with Helm managed by Tilt for local development. All pods seem to be healthy, but I do see the exact same error message in either one of the kubemq-cluster pods.
Any ideas on what causes this error?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.