You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by "Vinh Nguyen (vinguye2)" <vi...@cisco.com> on 2007/02/16 02:16:04 UTC

publish array of Elements

Currently, NotificationProducer.publish() sends out a single Element.
Out of curiousity, would it make sense to enhance it to publish an array
of Elements?  A workaround is to wrap the array in a parent Element, and
publish the parent.  But I'm trying to see if anyone else has a reason
to publish an array of elements.
 

RE: publish array of Elements

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Additional publish() methods were added to NotificationProducer.
Originally there was just publish(Element).  Now there is
publish(Element[]).
 

-----Original Message-----
From: david2 [mailto:David.Bueche@l-3comcept.com] 
Sent: Wednesday, August 01, 2007 9:34 AM
To: muse-user@ws.apache.org
Subject: RE: publish array of Elements


Dan,

Did anything ever become of this?  I was calling addMessageContent
multiple times and wondering why only one of the Elements made it to the
Client.

-David

--
View this message in context:
http://www.nabble.com/publish-array-of-Elements-tf3237201.html#a11949219
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: publish array of Elements

Posted by david2 <Da...@l-3comcept.com>.
Dan,

Did anything ever become of this?  I was calling addMessageContent multiple
times and wondering why only one of the Elements made it to the Client.

-David

-- 
View this message in context: http://www.nabble.com/publish-array-of-Elements-tf3237201.html#a11949219
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: publish array of Elements

Posted by Daniel Jemiolo <da...@us.ibm.com>.
I actually don't think it will affect the NotificationMessage* APIs 
because a NotificationMessage can have multiple Elements in its message 
content section. If you look at the NotificationMessage API, it has getter 
methods to iterate over and select the Elements in the payload section. 
So, the publish() method is actually the part that is inconsistent with 
the spec and the consumer APIs; since publish() is just taking your 
content and putting it in a NotificationMessage object, it should be 
possible to add multiple elements.

That said, what's done is done, and we can't get rid of the publish() 
methods we already have. I'm slightly concerned about API bloat, but not 
enough to disagree if multiple users want it. I just wanted to see if any 
of the other users/developers had an opinion before I added the code.

Dan



"Vinh Nguyen \(vinguye2\)" <vi...@cisco.com> wrote on 02/16/2007 
12:54:58 PM:

> Hehe, sorry about this new request, Dan.  The array idea just came up
> recently after stumbling upon the issue.
> 
> I think it's a bit more difficult to implement this new update since it
> involves updates to both server and client classes.  In particular, this
> will affect NotificationMessageListener and NotificationMessage, both of
> which currently assume a single Element value.
> 
> The easiest way around this is for developers to just wrap their array
> in a single Element, and publish using the existing API.  We'd have to
> create a serializer to distribute to the client so that they can
> deserialize the Element and extract the array.  But, that's no different
> than what we do now for operations, where we have to create serializers
> for custom types.  So I'm not sure what's the best approach.
> 
> 
> -----Original Message-----
> From: Daniel Jemiolo [mailto:danjemiolo@us.ibm.com] 
> Sent: Friday, February 16, 2007 7:47 AM
> To: muse-user@ws.apache.org
> Subject: RE: publish array of Elements
> 
> I suppose this will also require us to make array versions of the other
> publish() methods (for XmlSerializable and Object), which would make six
> publish() methods. Like the last API addition, I'm going to let this sit
> for 24 hours and let people chime in with their pros/cons. If no one
> cares, I'll do it this weekend.
> 
> Dan
> 
> 
> 
> "Rosberg Mattias" <Ma...@tetrapak.com> wrote on 02/16/2007 
> 07:59:02 AM:
> 
> > I think it's a great idea.
> > 
> > If you have a situation where you like to publish information that is 
> sampled 
> > with very high frequency in your device it could save a lot of 
> performance if 
> > you can buffer the samples and send them in an array (timestamped)
> with 
> some 
> > interval, say every 10 seconds or so.
> > 
> > An array of Elements will also result in less bandwidth usage since
> the 
> > overhead in the SOAP message will be the same if you send one sample
> or 
> a thousand. 
> > 
> > -----Original Message-----
> > From: Vinh Nguyen (vinguye2) [mailto:vinguye2@cisco.com]
> > Sent: Fri 2/16/2007 2:16 AM
> > To: muse-user@ws.apache.org
> > Subject: publish array of Elements
> > 
> > Currently, NotificationProducer.publish() sends out a single Element.
> > Out of curiousity, would it make sense to enhance it to publish an
> array
> > of Elements?  A workaround is to wrap the array in a parent Element,
> and
> > publish the parent.  But I'm trying to see if anyone else has a reason
> > to publish an array of elements.
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: publish array of Elements

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Hehe, sorry about this new request, Dan.  The array idea just came up
recently after stumbling upon the issue.

I think it's a bit more difficult to implement this new update since it
involves updates to both server and client classes.  In particular, this
will affect NotificationMessageListener and NotificationMessage, both of
which currently assume a single Element value.

The easiest way around this is for developers to just wrap their array
in a single Element, and publish using the existing API.  We'd have to
create a serializer to distribute to the client so that they can
deserialize the Element and extract the array.  But, that's no different
than what we do now for operations, where we have to create serializers
for custom types.  So I'm not sure what's the best approach.
 

-----Original Message-----
From: Daniel Jemiolo [mailto:danjemiolo@us.ibm.com] 
Sent: Friday, February 16, 2007 7:47 AM
To: muse-user@ws.apache.org
Subject: RE: publish array of Elements

I suppose this will also require us to make array versions of the other
publish() methods (for XmlSerializable and Object), which would make six
publish() methods. Like the last API addition, I'm going to let this sit
for 24 hours and let people chime in with their pros/cons. If no one
cares, I'll do it this weekend.

Dan



"Rosberg Mattias" <Ma...@tetrapak.com> wrote on 02/16/2007 
07:59:02 AM:

> I think it's a great idea.
> 
> If you have a situation where you like to publish information that is 
sampled 
> with very high frequency in your device it could save a lot of 
performance if 
> you can buffer the samples and send them in an array (timestamped)
with 
some 
> interval, say every 10 seconds or so.
> 
> An array of Elements will also result in less bandwidth usage since
the 
> overhead in the SOAP message will be the same if you send one sample
or 
a thousand. 
> 
> -----Original Message-----
> From: Vinh Nguyen (vinguye2) [mailto:vinguye2@cisco.com]
> Sent: Fri 2/16/2007 2:16 AM
> To: muse-user@ws.apache.org
> Subject: publish array of Elements
> 
> Currently, NotificationProducer.publish() sends out a single Element.
> Out of curiousity, would it make sense to enhance it to publish an
array
> of Elements?  A workaround is to wrap the array in a parent Element,
and
> publish the parent.  But I'm trying to see if anyone else has a reason
> to publish an array of elements.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: publish array of Elements

Posted by Daniel Jemiolo <da...@us.ibm.com>.
I suppose this will also require us to make array versions of the other 
publish() methods (for XmlSerializable and Object), which would make six 
publish() methods. Like the last API addition, I'm going to let this sit 
for 24 hours and let people chime in with their pros/cons. If no one 
cares, I'll do it this weekend.

Dan



"Rosberg Mattias" <Ma...@tetrapak.com> wrote on 02/16/2007 
07:59:02 AM:

> I think it's a great idea.
> 
> If you have a situation where you like to publish information that is 
sampled 
> with very high frequency in your device it could save a lot of 
performance if 
> you can buffer the samples and send them in an array (timestamped) with 
some 
> interval, say every 10 seconds or so.
> 
> An array of Elements will also result in less bandwidth usage since the 
> overhead in the SOAP message will be the same if you send one sample or 
a thousand. 
> 
> -----Original Message-----
> From: Vinh Nguyen (vinguye2) [mailto:vinguye2@cisco.com]
> Sent: Fri 2/16/2007 2:16 AM
> To: muse-user@ws.apache.org
> Subject: publish array of Elements
> 
> Currently, NotificationProducer.publish() sends out a single Element.
> Out of curiousity, would it make sense to enhance it to publish an array
> of Elements?  A workaround is to wrap the array in a parent Element, and
> publish the parent.  But I'm trying to see if anyone else has a reason
> to publish an array of elements.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


RE: publish array of Elements

Posted by Rosberg Mattias <Ma...@tetrapak.com>.
I think it's a great idea.

If you have a situation where you like to publish information that is sampled with very high frequency in your device it could save a lot of performance if you can buffer the samples and send them in an array (timestamped) with some interval, say every 10 seconds or so.

An array of Elements will also result in less bandwidth usage since the overhead in the SOAP message will be the same if you send one sample or a thousand. 

-----Original Message-----
From: Vinh Nguyen (vinguye2) [mailto:vinguye2@cisco.com]
Sent: Fri 2/16/2007 2:16 AM
To: muse-user@ws.apache.org
Subject: publish array of Elements
 
Currently, NotificationProducer.publish() sends out a single Element.
Out of curiousity, would it make sense to enhance it to publish an array
of Elements?  A workaround is to wrap the array in a parent Element, and
publish the parent.  But I'm trying to see if anyone else has a reason
to publish an array of elements.