You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Nirav <ni...@i-logicon.co.in> on 2007/03/05 09:19:33 UTC
Re: [jira] Attachment in form of byte[]
OK,
Thanks for help!
And atlast can you help me in getting attachment from Normalized Message?
'getAttachment()' method of Normalized Message returns DataHandler, How do I
convert it into byte[] or String object?
--
View this message in context: http://www.nabble.com/Attachment-in-form-of-byte---tf3146867s12049.html#a9307091
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
Re: Attachment in form of byte[]
Posted by Guillaume Nodet <gn...@gmail.com>.
On 3/21/07, Nirav <ni...@i-logicon.co.in> wrote:
>
>
> Truly Helpful,
>
> Thanks.
>
> I think I can get one more solution from you.
>
> You can have an overview of my project by clicking below link...
>
> http://forum.java.sun.com/thread.jspa?forumID=512&threadID=5132641
>
> Now my problem is after time span like 4-5 hours my NMR stops accepting
> uncompressed messages.
You should check that:
* the seda queues are empty
* delivery channels are empty
* check if threads are waiting for something
All these checks can be done from a JMX console.
One usual problem is when a hand written component does not comply
with the JBI Meps and forget to send an exchange back with a DONE
status for example.
If you see that threads are all waiting for a resource, please post
the thread dump (Ctrl+Break / kill -3).
So, I can say like after uncompression nothing will happen!
>
> Even I am not getting any error message!
> --
> View this message in context:
> http://www.nabble.com/Attachment-in-form-of-byte---tf3146867s12049.html#a9590762
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
>
>
--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/
Re: Attachment in form of byte[]
Posted by Nirav <ni...@i-logicon.co.in>.
Truly Helpful,
Thanks.
I think I can get one more solution from you.
You can have an overview of my project by clicking below link...
http://forum.java.sun.com/thread.jspa?forumID=512&threadID=5132641
Now my problem is after time span like 4-5 hours my NMR stops accepting
uncompressed messages.
So, I can say like after uncompression nothing will happen!
Even I am not getting any error message!
--
View this message in context: http://www.nabble.com/Attachment-in-form-of-byte---tf3146867s12049.html#a9590762
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
Re: [jira] Attachment in form of byte[]
Posted by Bruce Snyder <br...@gmail.com>.
On 3/5/07, Nirav <ni...@i-logicon.co.in> wrote:
>
> OK,
>
> Thanks for help!
>
> And atlast can you help me in getting attachment from Normalized Message?
>
> 'getAttachment()' method of Normalized Message returns DataHandler, How do I
> convert it into byte[] or String object?
>From the DataHandler, you can grab an InputStream. ServiceMix even
provides a utility class that contains a method for copying an
InputStream. See
org.apache.servicemix.jbi.util.FileUtil.copyInputStream for more
information.
Below is an example of grabbing an attachment and using the FileUtil
class to copy the InputStream:
if (in.getAttachmentNames() != null && in.getAttachmentNames().size() > 0) {
for (Iterator it = in.getAttachmentNames().iterator(); it.hasNext();) {
String name = (String) it.next();
DataHandler dh = in.getAttachment(name);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FileUtil.copyInputStream(dh.getInputStream(), baos);
// Do something w/ the baos here
}
}
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/