Giter Club home page Giter Club logo

kubemq-go's People

Contributors

haswalt avatar ido-sheffer avatar kubemq avatar liornabat avatar peter-svensson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubemq-go's Issues

No Client ID in QueryReceive

Hi, I was wondering why there is no client ID in QueryReceive and CommandReceive, I kinda need access to Client IDs

Event store stream function goroutine

The stream send function pushes the message into the eventCh and it's processed in another goroutine (

go func() {
), so while gracefully shutting down the application, it's possible to lose the message before pushing to the KubeMQ.

Is there any way (except time sleep) to wait for send goroutine before shutting down the application?

Missing tags in response to query via grpc

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

err := client.NewResponse().
I did add some tags. So it start to look:

	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:

client, err := kubemq.NewClient(ctx,

		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.

Event.ClientId always empty on the receiver side

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.

Please, allow to create QueuesClient from Client directly

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.

invalid channel value, no wildcards are allowed

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?

go get -u install fails

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

undefined resty.R

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

RPC error when sending to QueuesStreamClient

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.