0

Here is what I mean to ask:

  1. Component A is publishing objects to Component B using MQ Server
  2. Component A is compiled and runs on Java 6
  3. Component B is compiled and runs on Java 4

What will happen ?

I dont have enough infrastructure to test this out.

Sachin Thapa
  • 3,559
  • 4
  • 24
  • 42

2 Answers2

3

You will probably get an unsupported major / minor exception. Have a look at this post that talks about it:

How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

Basically, you should compile all of your source to run on a particular version of Java.

Community
  • 1
  • 1
yamafontes
  • 5,552
  • 1
  • 18
  • 18
  • 2
    You'll get that error even if you didn'T use any features that are unsupported by the older Java - but if that's true, just compile with the old version and it will run on both. New versions have all been backward compatible by now. – Johannes H. Nov 12 '13 at 22:42
0

In your case Component A must write something which Component B can understand. Nothing else matters.

You can't actually pass objects over a messaging system. All you can do is to serialize the data into bytes at one end and deserialize the data at the other. This means that classes at one end can be completely different to those at the other (not just different versions, but even different languages). The problem is the wire protocol needs to be compatible.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130