You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jeremy Gooch (JIRA)" <ji...@apache.org> on 2017/02/23 12:11:45 UTC

[jira] [Comment Edited] (PROTON-1415) go binding does not create durable subscriber

    [ https://issues.apache.org/jira/browse/PROTON-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15880158#comment-15880158 ] 

Jeremy Gooch edited comment on PROTON-1415 at 2/23/17 12:11 PM:
----------------------------------------------------------------

Thanks for looking into this.

I found a problem with the code:-

{{make}} failed, complaining about a lack of type on {{PN_TRANSPORT_READ_CLOSED}} in _event.h_.

I changed line 363 to read:-

{{static const pn_event_type_t PN_TRANSPORT_READ_CLOSED = PN_TRANSPORT_TAIL_CLOSED;}}

The project then built successfully (pull request = https://github.com/alanconway/qpid-proton/pull/1).

I'm now testing my client app, and will provide an update shortly.


was (Author: goochjs):
Thanks for looking into this.

I found two problems:-

h2. 1. make failed

It complained about a lack of type on {{PN_TRANSPORT_READ_CLOSED}} in _event.h_.

I changed line 363 to read:-

{{static const pn_event_type_t PN_TRANSPORT_READ_CLOSED = PN_TRANSPORT_TAIL_CLOSED;}}

The project then built successfully (pull request = https://github.com/alanconway/qpid-proton/pull/1).

h2. 2. negative WaitGroup counter

Then, when I ran my _receive.go_ client, it failed with the following error:-

{code}
root@1919183e6e52:/usr/src/go-electron# go run receive.go
2017/02/23 09:00:37 Connecting to amqp://localhost:5672
Listening on 1 connections
panic: sync: negative WaitGroup counter

goroutine 5 [running]:
panic(0x5369c0, 0xc420092020)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
sync.(*WaitGroup).Add(0x844fa0, 0xffffffffffffffff)
        /usr/local/go/src/sync/waitgroup.go:75 +0x1fe
sync.(*WaitGroup).Done(0x844fa0)
        /usr/local/go/src/sync/waitgroup.go:100 +0x34
main.consume(0x570178, 0x15)
        /usr/src/go-electron/receive.go:95 +0x530
created by main.main
        /usr/src/go-electron/receive.go:47 +0x2cb
exit status 2
{code}

I haven't yet managed to solve this second one.  Sample code is in my repo - https://github.com/goochjs/amqp-activemq-python-go/tree/master/go-electron

> go binding does not create durable subscriber
> ---------------------------------------------
>
>                 Key: PROTON-1415
>                 URL: https://issues.apache.org/jira/browse/PROTON-1415
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: go-binding
>    Affects Versions: 0.17.0
>         Environment: Docker for Windows 1.13.1
> Docker golang:1.7
> ActiveMQ 5.14.3 (Java 1.8.0_111)
>            Reporter: Jeremy Gooch
>            Assignee: Alan Conway
>
> When creating a subscription from Qpid Electron, the subscription name is not set, meaning that durable subscriptions cannot be created.
> Example code -> https://github.com/goochjs/amqp-activemq-python-go/blob/master/go-electron/receive.go
> Go example snippet (setting container ID):-
> 	container = electron.NewContainer(fmt.Sprintf("receive-client[%v]", os.Getpid()))
> Go example snippet (failing to set subscription name):-
> 	if r, err := c.Receiver(electron.LinkName(SubscriptionName), electron.Source("topic://"+AmqpResourceName)); err == nil {
> For comparison, I have a working Qpid Proton Python client, which sets both connection ID and subscription name -> https://github.com/goochjs/amqp-activemq-python-go/blob/master/python-proton/message_receiver.py
> Python example snippet (setting container ID):-
>       # Name the subscription after the script file name
>         event.container.container_id = __file__
> Python example snippet (setting subscription name):-
>         messaging_connection = event.container.connect(self.url)
>         event.container.create_receiver(
>             messaging_connection,
>             self.resource,
>             name=self.subscription_name,
>             options=durable
>         )



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org