Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest code of iotservice client is not working. It uses wrong version of amqp lib functions. #82

Open
PremSahooESL opened this issue Jul 25, 2023 · 7 comments

Comments

@PremSahooESL
Copy link

Application could not get started due to wrong method signture being used from eventhub package.
I am trying to use iotservice client on my application. I end up gettng below error.

image

@PremSahooESL
Copy link
Author

PremSahooESL commented Jul 25, 2023

Looks as if latest code does not use amqp 1.0.1 Lib.

@PremSahooESL
Copy link
Author

PremSahooESL commented Jul 25, 2023

Some how I managed to use old iotservice client code. but no luck. I am getting below error continuously wile using SendEvent() for sending C2D message.

Error: protocol error: received flow without next-incoming-id after session established

IoTHubClient, connectionErr := iotservice.NewFromConnectionString(SERVICE_CONNECTION_STRING)
	if connectionErr != nil {
		logger.Error(connectionErr)
	}
	ctx, cancel := context.WithTimeout(context.Background(), DEFAULT_CONTEXT_TIMEOUT_SEC*time.Second)
	defer cancel()

sendError := IoTHubClient.SendEvent(ctx, DEVICE_ID, payload,
			iotservice.WithSendProperties(msgProperties),
			iotservice.WithSendAck(iotservice.AckPositive),
			iotservice.WithSendUserID("Go lang Iot Service Client"),
			iotservice.WithSendMessageID(id.String()))

if sendError != nil {
			logger.Error("Error occurred while sending C-2-D message for device: ", DEVICE_ID, ", Error: ", sendError)
}

@PremSahooESL
Copy link
Author

Could you please help me on this? Its quite urgent.

Thanks in advance.

@amenzhinsky
Copy link
Owner

Could you try updating to @master?

@PremSahooESL
Copy link
Author

PremSahooESL commented Jul 25, 2023

Doing above solved the application startup error. Now application is getting started.
But while sending C2D message it throws same error.

### protocol error: received flow without next-incoming-id after session established

@PremSahooESL
Copy link
Author

PremSahooESL commented Jul 25, 2023

Is the iotservice client tested to send C2D message?

@den19980107
Copy link

Could you try updating to @master?

@amenzhinsky Can you add a new tag to the latest commit that solves the amqp library issue instead of using @master to the go mod file?

Thanks for maintaining this library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants