You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Check Peck <co...@gmail.com> on 2015/09/19 06:39:33 UTC

seeing weird issue with distribute queue recipe in curator

I am seeing very weird issue when using DistributedQueue recipe in Curator.
I am thinking it might be a bug in Zookeeper or Curator but not sure yet or
may be I am doing something silly.

I am trying to queue message in Zookeeper using DistributedQueue recipe:

    public void queueMessages() throws Exception {
        // below is the data I am sending
        DqTestHolder work = new DqTestHolder("103", "
DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
        this.queue.put(work);
    }

And here is my serializer class:

    public class DqTestHolderSerializer implements
QueueSerializer<DqTestHolder> {

        @Override
        public DqTestHolder deserialize(byte[] buffer) {
            // nothing here for now
        }

        @Override
        public byte[] serialize(DqTestHolder work) {
            return work.toString().getBytes();
        }
    }

And here is my DqTestHolder class:

    public class DqTestHolder {
        private final String clientId;
        private final String emailId;
        private final String clientName;

        public DqTestHolder(final String clientId, final String emailId,
final String clientName) {
            this.clientId = clientId;
            this.emailId = emailId;
            this.clientName = clientName;
        }

        // getters here

        public String toString() {
            return this.clientId + "=" + this.emailId + "=" +
this.clientName;
        }
    }

Now after I queue above data and I go and see exhibitor, I am seeing
something like this: You see it is appending bracket ")" infront of data
and sometimes I see "(" this as well which is not what I am sending above.

    )103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O

This is only happening when we send data with "-" in it I guess and if we
have something like this in emailId - "abcde@host.com" then I don't see any
bracket and it shows correctly what I am sending. So if anyone tried to get
data using getData() method, I get exactly what I see in exhibitor but not
what I have sent above.

Also when we try to use getData() method of curator to get above data from
znode, I see some wierd characters getting appended to it as well. I am
using Curator 2.8.0

Re: seeing weird issue with distribute queue recipe in curator

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
Please open an issue in Jira and provide a test. I haven’t heard of anything like this before.

-Jordan



On September 18, 2015 at 11:40:01 PM, Check Peck (comptechgeeky@gmail.com) wrote:

I am seeing very weird issue when using DistributedQueue recipe in Curator. I am thinking it might be a bug in Zookeeper or Curator but not sure yet or may be I am doing something silly.

I am trying to queue message in Zookeeper using DistributedQueue recipe:

    public void queueMessages() throws Exception {
        // below is the data I am sending
        DqTestHolder work = new DqTestHolder("103", "DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
        this.queue.put(work);
    }
   
And here is my serializer class:

    public class DqTestHolderSerializer implements QueueSerializer<DqTestHolder> {

        @Override
        public DqTestHolder deserialize(byte[] buffer) {
            // nothing here for now
        }

        @Override
        public byte[] serialize(DqTestHolder work) {
            return work.toString().getBytes();
        }
    }
   
And here is my DqTestHolder class:

    public class DqTestHolder {
        private final String clientId;
        private final String emailId;
        private final String clientName;

        public DqTestHolder(final String clientId, final String emailId, final String clientName) {
            this.clientId = clientId;
            this.emailId = emailId;
            this.clientName = clientName;
        }

        // getters here

        public String toString() {
            return this.clientId + "=" + this.emailId + "=" + this.clientName;
        }
    }

Now after I queue above data and I go and see exhibitor, I am seeing something like this: You see it is appending bracket ")" infront of data and sometimes I see "(" this as well which is not what I am sending above.

    )103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O
   
This is only happening when we send data with "-" in it I guess and if we have something like this in emailId - "abcde@host.com" then I don't see any bracket and it shows correctly what I am sending. So if anyone tried to get data using getData() method, I get exactly what I see in exhibitor but not what I have sent above.

Also when we try to use getData() method of curator to get above data from znode, I see some wierd characters getting appended to it as well. I am using Curator 2.8.0



Re: seeing weird issue with distribute queue recipe in curator

Posted by Check Peck <co...@gmail.com>.
I have a code which is producing events to zookeeper in which consumer is
null and then I have separate code in separate project in which I have
consumer. We don't need "deserialize" code when we are sending data to
zookeeper right? That's why I have removed it to show case the problem. I
can add it but that deserialize method won't be called from the code which
is producing the events since I have set consumer to null.

On Wed, Sep 23, 2015 at 2:32 PM, Martin Serrano <ma...@attivio.com> wrote:

> I'm confused.  How can this possibly work without deserialize code?
> That shouldn't even compile.
>
> -Martin
>
> On 09/23/2015 05:12 PM, Check Peck wrote:
> >Does anyone have any thoughts on this?
> >>On Fri, Sep 18, 2015 at 9:39 PM, Check Peck <comptechgeeky@gmail.com
> >wrote:
> >>>I am seeing very weird issue when using DistributedQueue recipe in
> >>Curator. I am thinking it might be a bug in Zookeeper or Curator but not
> >>sure yet or may be I am doing something silly.
> >>>>I am trying to queue message in Zookeeper using DistributedQueue
> recipe:
> >>>>public void queueMessages() throws Exception {
> >>// below is the data I am sending
> >>DqTestHolder work = new DqTestHolder("103", "
> >>DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
> >>this.queue.put(work);
> >>}
> >>>>And here is my serializer class:
> >>>>public class DqTestHolderSerializer implements
> >>QueueSerializer<DqTestHolder>{
> >>>>@Override
> >>public DqTestHolder deserialize(byte[]buffer) {
> >>// nothing here for now
> >>}
> >>>>@Override
> >>public byte[]serialize(DqTestHolder work) {
> >>return work.toString().getBytes();
> >>}
> >>}
> >>>>And here is my DqTestHolder class:
> >>>>public class DqTestHolder {
> >>private final String clientId;
> >>private final String emailId;
> >>private final String clientName;
> >>>>public DqTestHolder(final String clientId, final String emailId,
> >>final String clientName) {
> >>this.clientId = clientId;
> >>this.emailId = emailId;
> >>this.clientName = clientName;
> >>}
> >>>>// getters here
> >>>>public String toString() {
> >>return this.clientId + "=" + this.emailId + "=" +
> >>this.clientName;
> >>}
> >>}
> >>>>Now after I queue above data and I go and see exhibitor, I am seeing
> >>something like this: You see it is appending bracket ")" infront of data
> >>and sometimes I see "(" this as well which is not what I am sending
> above.
> >>>>)103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O
> >>>>This is only happening when we send data with "-" in it I guess and if
> we
> >>have something like this in emailId - "abcde@host.com" then I don't see
> >>any bracket and it shows correctly what I am sending. So if anyone tried
> to
> >>get data using getData() method, I get exactly what I see in exhibitor
> but
> >>not what I have sent above.
> >>>>Also when we try to use getData() method of curator to get above data
> from
> >>znode, I see some wierd characters getting appended to it as well. I am
> >>using Curator 2.8.0
> >>>>>>
>

Re: seeing weird issue with distribute queue recipe in curator

Posted by Check Peck <co...@gmail.com>.
I have a code which is producing events to zookeeper in which consumer is
null and then I have separate code in separate project in which I have
consumer. We don't need "deserialize" code when we are sending data to
zookeeper right? That's why I have removed it to show case the problem. I
can add it but that deserialize method won't be called from the code which
is producing the events since I have set consumer to null.

On Wed, Sep 23, 2015 at 2:32 PM, Martin Serrano <ma...@attivio.com> wrote:

> I'm confused.  How can this possibly work without deserialize code?
> That shouldn't even compile.
>
> -Martin
>
> On 09/23/2015 05:12 PM, Check Peck wrote:
> >Does anyone have any thoughts on this?
> >>On Fri, Sep 18, 2015 at 9:39 PM, Check Peck <comptechgeeky@gmail.com
> >wrote:
> >>>I am seeing very weird issue when using DistributedQueue recipe in
> >>Curator. I am thinking it might be a bug in Zookeeper or Curator but not
> >>sure yet or may be I am doing something silly.
> >>>>I am trying to queue message in Zookeeper using DistributedQueue
> recipe:
> >>>>public void queueMessages() throws Exception {
> >>// below is the data I am sending
> >>DqTestHolder work = new DqTestHolder("103", "
> >>DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
> >>this.queue.put(work);
> >>}
> >>>>And here is my serializer class:
> >>>>public class DqTestHolderSerializer implements
> >>QueueSerializer<DqTestHolder>{
> >>>>@Override
> >>public DqTestHolder deserialize(byte[]buffer) {
> >>// nothing here for now
> >>}
> >>>>@Override
> >>public byte[]serialize(DqTestHolder work) {
> >>return work.toString().getBytes();
> >>}
> >>}
> >>>>And here is my DqTestHolder class:
> >>>>public class DqTestHolder {
> >>private final String clientId;
> >>private final String emailId;
> >>private final String clientName;
> >>>>public DqTestHolder(final String clientId, final String emailId,
> >>final String clientName) {
> >>this.clientId = clientId;
> >>this.emailId = emailId;
> >>this.clientName = clientName;
> >>}
> >>>>// getters here
> >>>>public String toString() {
> >>return this.clientId + "=" + this.emailId + "=" +
> >>this.clientName;
> >>}
> >>}
> >>>>Now after I queue above data and I go and see exhibitor, I am seeing
> >>something like this: You see it is appending bracket ")" infront of data
> >>and sometimes I see "(" this as well which is not what I am sending
> above.
> >>>>)103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O
> >>>>This is only happening when we send data with "-" in it I guess and if
> we
> >>have something like this in emailId - "abcde@host.com" then I don't see
> >>any bracket and it shows correctly what I am sending. So if anyone tried
> to
> >>get data using getData() method, I get exactly what I see in exhibitor
> but
> >>not what I have sent above.
> >>>>Also when we try to use getData() method of curator to get above data
> from
> >>znode, I see some wierd characters getting appended to it as well. I am
> >>using Curator 2.8.0
> >>>>>>
>

Re: seeing weird issue with distribute queue recipe in curator

Posted by Martin Serrano <ma...@attivio.com>.
I'm confused.  How can this possibly work without deserialize code? 
That shouldn't even compile.

-Martin

On 09/23/2015 05:12 PM, Check Peck wrote:
>Does anyone have any thoughts on this?
>>On Fri, Sep 18, 2015 at 9:39 PM, Check Peck <co...@gmail.com>wrote:
>>>I am seeing very weird issue when using DistributedQueue recipe in
>>Curator. I am thinking it might be a bug in Zookeeper or Curator but not
>>sure yet or may be I am doing something silly.
>>>>I am trying to queue message in Zookeeper using DistributedQueue recipe:
>>>>public void queueMessages() throws Exception {
>>// below is the data I am sending
>>DqTestHolder work = new DqTestHolder("103", "
>>DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
>>this.queue.put(work);
>>}
>>>>And here is my serializer class:
>>>>public class DqTestHolderSerializer implements
>>QueueSerializer<DqTestHolder>{
>>>>@Override
>>public DqTestHolder deserialize(byte[]buffer) {
>>// nothing here for now
>>}
>>>>@Override
>>public byte[]serialize(DqTestHolder work) {
>>return work.toString().getBytes();
>>}
>>}
>>>>And here is my DqTestHolder class:
>>>>public class DqTestHolder {
>>private final String clientId;
>>private final String emailId;
>>private final String clientName;
>>>>public DqTestHolder(final String clientId, final String emailId,
>>final String clientName) {
>>this.clientId = clientId;
>>this.emailId = emailId;
>>this.clientName = clientName;
>>}
>>>>// getters here
>>>>public String toString() {
>>return this.clientId + "=" + this.emailId + "=" +
>>this.clientName;
>>}
>>}
>>>>Now after I queue above data and I go and see exhibitor, I am seeing
>>something like this: You see it is appending bracket ")" infront of data
>>and sometimes I see "(" this as well which is not what I am sending above.
>>>>)103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O
>>>>This is only happening when we send data with "-" in it I guess and if we
>>have something like this in emailId - "abcde@host.com" then I don't see
>>any bracket and it shows correctly what I am sending. So if anyone tried to
>>get data using getData() method, I get exactly what I see in exhibitor but
>>not what I have sent above.
>>>>Also when we try to use getData() method of curator to get above data from
>>znode, I see some wierd characters getting appended to it as well. I am
>>using Curator 2.8.0
>>>>>>

Re: seeing weird issue with distribute queue recipe in curator

Posted by Check Peck <co...@gmail.com>.
Does anyone have any thoughts on this?

On Fri, Sep 18, 2015 at 9:39 PM, Check Peck <co...@gmail.com> wrote:

> I am seeing very weird issue when using DistributedQueue recipe in
> Curator. I am thinking it might be a bug in Zookeeper or Curator but not
> sure yet or may be I am doing something silly.
>
> I am trying to queue message in Zookeeper using DistributedQueue recipe:
>
>     public void queueMessages() throws Exception {
>         // below is the data I am sending
>         DqTestHolder work = new DqTestHolder("103", "
> DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
>         this.queue.put(work);
>     }
>
> And here is my serializer class:
>
>     public class DqTestHolderSerializer implements
> QueueSerializer<DqTestHolder> {
>
>         @Override
>         public DqTestHolder deserialize(byte[] buffer) {
>             // nothing here for now
>         }
>
>         @Override
>         public byte[] serialize(DqTestHolder work) {
>             return work.toString().getBytes();
>         }
>     }
>
> And here is my DqTestHolder class:
>
>     public class DqTestHolder {
>         private final String clientId;
>         private final String emailId;
>         private final String clientName;
>
>         public DqTestHolder(final String clientId, final String emailId,
> final String clientName) {
>             this.clientId = clientId;
>             this.emailId = emailId;
>             this.clientName = clientName;
>         }
>
>         // getters here
>
>         public String toString() {
>             return this.clientId + "=" + this.emailId + "=" +
> this.clientName;
>         }
>     }
>
> Now after I queue above data and I go and see exhibitor, I am seeing
> something like this: You see it is appending bracket ")" infront of data
> and sometimes I see "(" this as well which is not what I am sending above.
>
>     )103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O
>
> This is only happening when we send data with "-" in it I guess and if we
> have something like this in emailId - "abcde@host.com" then I don't see
> any bracket and it shows correctly what I am sending. So if anyone tried to
> get data using getData() method, I get exactly what I see in exhibitor but
> not what I have sent above.
>
> Also when we try to use getData() method of curator to get above data from
> znode, I see some wierd characters getting appended to it as well. I am
> using Curator 2.8.0
>
>
>

Re: seeing weird issue with distribute queue recipe in curator

Posted by Check Peck <co...@gmail.com>.
Does anyone have any thoughts on this?

On Fri, Sep 18, 2015 at 9:39 PM, Check Peck <co...@gmail.com> wrote:

> I am seeing very weird issue when using DistributedQueue recipe in
> Curator. I am thinking it might be a bug in Zookeeper or Curator but not
> sure yet or may be I am doing something silly.
>
> I am trying to queue message in Zookeeper using DistributedQueue recipe:
>
>     public void queueMessages() throws Exception {
>         // below is the data I am sending
>         DqTestHolder work = new DqTestHolder("103", "
> DL-hOst-AbcdeFgh-Pletrs@host.com", "K15O");
>         this.queue.put(work);
>     }
>
> And here is my serializer class:
>
>     public class DqTestHolderSerializer implements
> QueueSerializer<DqTestHolder> {
>
>         @Override
>         public DqTestHolder deserialize(byte[] buffer) {
>             // nothing here for now
>         }
>
>         @Override
>         public byte[] serialize(DqTestHolder work) {
>             return work.toString().getBytes();
>         }
>     }
>
> And here is my DqTestHolder class:
>
>     public class DqTestHolder {
>         private final String clientId;
>         private final String emailId;
>         private final String clientName;
>
>         public DqTestHolder(final String clientId, final String emailId,
> final String clientName) {
>             this.clientId = clientId;
>             this.emailId = emailId;
>             this.clientName = clientName;
>         }
>
>         // getters here
>
>         public String toString() {
>             return this.clientId + "=" + this.emailId + "=" +
> this.clientName;
>         }
>     }
>
> Now after I queue above data and I go and see exhibitor, I am seeing
> something like this: You see it is appending bracket ")" infront of data
> and sometimes I see "(" this as well which is not what I am sending above.
>
>     )103=DL-hOst-AbcdeFgh-Pletrs@host.com=K15O
>
> This is only happening when we send data with "-" in it I guess and if we
> have something like this in emailId - "abcde@host.com" then I don't see
> any bracket and it shows correctly what I am sending. So if anyone tried to
> get data using getData() method, I get exactly what I see in exhibitor but
> not what I have sent above.
>
> Also when we try to use getData() method of curator to get above data from
> znode, I see some wierd characters getting appended to it as well. I am
> using Curator 2.8.0
>
>
>