<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java to OpenVMS Mailbox in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716342#M40871</link>
    <description>&amp;gt; If they would be "thread-safe". &lt;BR /&gt;&lt;BR /&gt;Mailboxes are definitely thread safe in the sense that multiple threads cannot write to a mailbox "at the same time" because mailboxes are robustly synchronised at the operating system level. One thread will always "win" the race.&lt;BR /&gt;&lt;BR /&gt;As others have mentioned, mailbox I/O is, by default, end-to-end synchronous. That is, the writer will wait for the message to be read before proceeding. This may have an effect on threading, as a thread may block on a mailbox write. If that prevents another thread from reading the mailbox, you could have a deadlock (depends on your threading mechanism being capable of switching threads during an OS level I/O stall).&lt;BR /&gt;&lt;BR /&gt; You may not have control over mailbox read behaviour when do a device independent/blind I/O. If you access a mailbox explicitly, you can do asynch I/O.</description>
    <pubDate>Tue, 23 Nov 2010 20:27:01 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2010-11-23T20:27:01Z</dc:date>
    <item>
      <title>Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716330#M40859</link>
      <description>We have a legacy application which runs on OpenVMS which is written in C and listens on both Sockets and OpenVMS Mailboxes. I am writing a Java Webservice which is supposed to take a plain ASCII text string and forward that message to the legacy system. Rather than deal with the translation issues with the socket communications, I was wondering if anyone had some examples of how to write a string to an OpenVMS Mailbox from JAVA.</description>
      <pubDate>Mon, 22 Nov 2010 17:41:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716330#M40859</guid>
      <dc:creator>OwensJ</dc:creator>
      <dc:date>2010-11-22T17:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716331#M40860</link>
      <description>Treat the mailbox just as you would any other file.&lt;BR /&gt;&lt;BR /&gt;If it doesn't work, please post any error messages.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Nov 2010 21:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716331#M40860</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-11-22T21:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716332#M40861</link>
      <description>Wow really?  I thought it was something like a memory queue.   I can just open it and write text to it?  This should be interesting.</description>
      <pubDate>Mon, 22 Nov 2010 21:09:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716332#M40861</guid>
      <dc:creator>OwensJ</dc:creator>
      <dc:date>2010-11-22T21:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716333#M40862</link>
      <description>OwensJ,&lt;BR /&gt;&lt;BR /&gt;I concur with John. While a mailbox is implemented as an in-memory data structure, its access from a program is as a normal file.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Mon, 22 Nov 2010 21:16:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716333#M40862</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2010-11-22T21:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716334#M40863</link>
      <description>Would OwensJ need/want to specify the mailbox as a stream mailbox for BufferedInputStream or is Java happy with records?&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher&lt;BR /&gt;&lt;BR /&gt;PS. Java Sockets are fully functional and quite easy with oodles of examples all over the web.</description>
      <pubDate>Mon, 22 Nov 2010 21:47:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716334#M40863</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2010-11-22T21:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716335#M40864</link>
      <description>I've seen several examples and used Java sockets myself in the past, however never from Java to C, and on an OpenVMS system.  I've read a few threads on here that say there may be some issues with this, though maybe not in straight text.   I'm going to try it anyway later in the week, but since mailboxes are another alternative, I wanted to look into them since I had no idea how they worked on openvms.</description>
      <pubDate>Mon, 22 Nov 2010 22:03:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716335#M40864</guid>
      <dc:creator>OwensJ</dc:creator>
      <dc:date>2010-11-22T22:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716336#M40865</link>
      <description>The language used at each socket really doesn't matter - a socket is a socket. As long as the sender and receiver are talking the same message format and character set, it doesn't matter.  (We have Pascal servers receiving messages from C#, PHP, Java, C).&lt;BR /&gt;&lt;BR /&gt;Personally, I'd go down the socket path first as it doesn't lock you into VMS mailboxes.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Nov 2010 23:32:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716336#M40865</guid>
      <dc:creator>Chris Barratt</dc:creator>
      <dc:date>2010-11-22T23:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716337#M40866</link>
      <description>Since you are trying to avoid program changes, yes you can treat the mailbox just like a file.  If it is easier, use a logical name to point to a real file for testing the data stream from the Java app.  Point the logical to a mailbox for testing the real app.  With VMS its just that simple.&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Tue, 23 Nov 2010 01:09:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716337#M40866</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2010-11-23T01:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716338#M40867</link>
      <description>You could use J2VMS for this too. &lt;BR /&gt;The snag with treating mailboxes as files is that the writer or reader hangs until someone reads or writes to the mailbox. Probably not a problem, but something to remember.&lt;BR /&gt;Have you thought about replacing the mailbox with either socket or perhaps lighweight queuing? Should not be hard and more natural to the Java environment; and much faster with no limitations on size or format of messages. Remember, mailboxes are record-formatted devices.</description>
      <pubDate>Tue, 23 Nov 2010 09:50:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716338#M40867</guid>
      <dc:creator>John Apps</dc:creator>
      <dc:date>2010-11-23T09:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716339#M40868</link>
      <description>RE: John&lt;BR /&gt;&lt;BR /&gt;You are correct about the hang, IF, the read posted is a synchronous one.  Since the app already uses mailboxes, I suspect that the reads are done async with an AST trigger.  The emphasis here is that the asker here does not want to change the legacy app.  Since it already handles mailboxes, writing to one should not be a problem.&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Tue, 23 Nov 2010 11:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716339#M40868</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2010-11-23T11:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716340#M40869</link>
      <description>This was a question I had while thinking about using it as a file.  If they would be "thread-safe".   I think based on the fact that several web-requests could come in that may try to open and write to the same mailbox at the same time, it would be much safer to go the socket route.</description>
      <pubDate>Tue, 23 Nov 2010 14:17:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716340#M40869</guid>
      <dc:creator>OwensJ</dc:creator>
      <dc:date>2010-11-23T14:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716341#M40870</link>
      <description>Yes you can open the mailbox from multiple streams.  The "records" will be processed in order of receipt.&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Tue, 23 Nov 2010 14:25:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716341#M40870</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2010-11-23T14:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716342#M40871</link>
      <description>&amp;gt; If they would be "thread-safe". &lt;BR /&gt;&lt;BR /&gt;Mailboxes are definitely thread safe in the sense that multiple threads cannot write to a mailbox "at the same time" because mailboxes are robustly synchronised at the operating system level. One thread will always "win" the race.&lt;BR /&gt;&lt;BR /&gt;As others have mentioned, mailbox I/O is, by default, end-to-end synchronous. That is, the writer will wait for the message to be read before proceeding. This may have an effect on threading, as a thread may block on a mailbox write. If that prevents another thread from reading the mailbox, you could have a deadlock (depends on your threading mechanism being capable of switching threads during an OS level I/O stall).&lt;BR /&gt;&lt;BR /&gt; You may not have control over mailbox read behaviour when do a device independent/blind I/O. If you access a mailbox explicitly, you can do asynch I/O.</description>
      <pubDate>Tue, 23 Nov 2010 20:27:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716342#M40871</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-11-23T20:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716343#M40872</link>
      <description>All good to know, thank you!</description>
      <pubDate>Tue, 23 Nov 2010 20:32:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716343#M40872</guid>
      <dc:creator>OwensJ</dc:creator>
      <dc:date>2010-11-23T20:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716344#M40873</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The reason I mentioned stream i/o is, having used java.io.BufferedInputStream for Socket i/o, I wasn't sure the exact behaviour the OP was expecting with a JAVA program writing/streaming to a mailbox, expecially if he intented to have multiple simultaneous writers, or messages larger than the mailbox size.&lt;BR /&gt;&lt;BR /&gt;For those unaware of the streaming possibilities of the VMS Mailbox may I suggest you look up the io$m_stream modifier at: -&lt;BR /&gt;&lt;A href="http://h30266.www3.hp.com/odl/i64os/opsys/vmsos84/BA554_90018/ch04s03.html#mbx-read-func" target="_blank"&gt;http://h30266.www3.hp.com/odl/i64os/opsys/vmsos84/BA554_90018/ch04s03.html#mbx-read-func&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For those worried about blocking on a write there is always the io$m_now and io$m_norswait modifiers. &lt;BR /&gt;&lt;BR /&gt;If this is all happening on the same node then I would use Mailboxes over Sockets but you'd want to be "listening" on a single control mailbox for connection requests that would include the connect/user/process specific mailbox device name that your server must connect back to to complete the handshake. How JAVA  would call a VMS system service directly to creates a mailbox, I know not. (But there seems to be stuff in the FAQ &lt;A href="http://www.compaq.com/java/faq/ovms.html)" target="_blank"&gt;http://www.compaq.com/java/faq/ovms.html)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Maybe the OS implementation-specific bits of other classes like Pipe do something useful? Or maybe Sockets are just easier and more transparent/generic after all?&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher</description>
      <pubDate>Wed, 24 Nov 2010 08:57:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716344#M40873</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2010-11-24T08:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716345#M40874</link>
      <description>&amp;gt;For those unaware of the streaming possibilities&lt;BR /&gt;&amp;gt;of the VMS Mailbox may I suggest you look up the io$m_stream modifier &lt;BR /&gt;&lt;BR /&gt;which only applies to reads, not writes.  You can do partial stream emulation by reading less than a full record at a time, but writes always introduce a record boundary.  For the OP that may not be a problem as long as he always writes a complete message and makes sure it fits within the mailbox buffer.  He might have to do a flush between writes depending on how the Java classes are implemented.</description>
      <pubDate>Wed, 24 Nov 2010 15:23:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716345#M40874</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2010-11-24T15:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716346#M40875</link>
      <description>&amp;gt;&amp;gt;For those unaware of the streaming possibilities &lt;BR /&gt;&amp;gt;&amp;gt;of the VMS Mailbox may I suggest you look up the io$m_stream modifier &lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;which only applies to reads, not writes.&lt;BR /&gt;&lt;BR /&gt;Which is why I gave the following direct link to "4.3.1 Read": -&lt;BR /&gt;&lt;A href="http://h30266.www3.hp.com/odl/i64os/opsys/vmsos84/BA554_90018/ch04s03.html#mbx-read-func" target="_blank"&gt;http://h30266.www3.hp.com/odl/i64os/opsys/vmsos84/BA554_90018/ch04s03.html#mbx-read-func&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; You can do partial stream emulation by&lt;BR /&gt;&amp;gt; reading less than a full record at a time,&lt;BR /&gt;&lt;BR /&gt;No! As is clearly explained in Figure 4-2 in the explicit refernce that I went to the trouble of providing, one can clearly see that a streaming read can read any number of records (and/or part there off) in a single $qio read without loss of residue.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; but writes always introduce a record &lt;BR /&gt;&amp;gt; boundary. &lt;BR /&gt;&lt;BR /&gt;So what?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; For the OP that may not be a problem as&lt;BR /&gt;&amp;gt; long as he always writes a complete&lt;BR /&gt;&amp;gt; message and makes sure it fits within the&lt;BR /&gt;&amp;gt; mailbox buffer. &lt;BR /&gt;&lt;BR /&gt;Quite. As I said "For the OP it may be a problem if . . ."&lt;BR /&gt;&lt;BR /&gt;&amp;gt; He might have to do a flush between writes&lt;BR /&gt;&lt;BR /&gt;Might? &lt;BR /&gt;&lt;BR /&gt;&amp;gt; depending on how the Java classes are &lt;BR /&gt;&amp;gt; implemented. &lt;BR /&gt;&lt;BR /&gt;I believe an implementer of the stream i/o interface has to "as a minimum" provide single-byte i/o. God bless Unix.&lt;BR /&gt;&lt;BR /&gt;Regards Richard Maher</description>
      <pubDate>Fri, 10 Dec 2010 05:19:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716346#M40875</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2010-12-10T05:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Java to OpenVMS Mailbox</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716347#M40876</link>
      <description>&amp;gt;&amp;gt;&amp;gt;For those unaware of the streaming possibilities &lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;of the VMS Mailbox may I suggest you look up the io$m_stream modifier &lt;BR /&gt;&amp;gt;&amp;gt; &lt;BR /&gt;&amp;gt;&amp;gt;which only applies to reads, not writes. &lt;BR /&gt;&lt;BR /&gt;&amp;gt;Which is why I gave the following direct link to "4.3.1 Read": - &lt;BR /&gt;&amp;gt;&lt;A href="http://h30266.www3.hp.com/odl/i64os/opsys/vmsos84/BA554_90018/ch04s03.html#m" target="_blank"&gt;http://h30266.www3.hp.com/odl/i64os/opsys/vmsos84/BA554_90018/ch04s03.html#m&lt;/A&gt;&lt;BR /&gt;bx-read-func &lt;BR /&gt;&lt;BR /&gt;I'm familiar with the article.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; You can do partial stream emulation by &lt;BR /&gt;&amp;gt;&amp;gt; reading less than a full record at a time, &lt;BR /&gt;&lt;BR /&gt;&amp;gt;No! As is clearly explained in Figure 4-2 in the explicit &lt;BR /&gt;&amp;gt;refernce that I went to the trouble of providing, one can &lt;BR /&gt;&amp;gt;clearly see that a streaming read can read any number of &lt;BR /&gt;&amp;gt;records (and/or part there off) in a single $qio read &lt;BR /&gt;&amp;gt;without loss of residue. &lt;BR /&gt;&lt;BR /&gt;You seem to be going out of your way to disagree with me while saying essentially the same thing I said.  The number of complete records you get is irrelevant; that works fine, even without IO$M_STREAM.  It's what happens when you run out of buffer before you get to the end of the final (possibly only) record; that's where IO$M_STREAM allows you to get "less than a full record at a time" (my words) or "and/or part thereof in a single $qio" (your words) without introducing a spurious record boundary.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; but writes always introduce a record &lt;BR /&gt;&amp;gt;&amp;gt; boundary. &lt;BR /&gt;&lt;BR /&gt;&amp;gt;So what?&lt;BR /&gt;&lt;BR /&gt;Because anyone doing stream I/O through mailboxes (such as anyone using pipe() in the CRTL) will eventually be bitten by this. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Dec 2010 19:06:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-to-openvms-mailbox/m-p/4716347#M40876</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2010-12-10T19:06:03Z</dc:date>
    </item>
  </channel>
</rss>

