ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » URGENT: Java and C++ Interoperability Design Issue

Post new topic  Reply to topic
 URGENT: Java and C++ Interoperability Design Issue « View previous topic :: View next topic » 
Author Message
skytorch
PostPosted: Wed Nov 06, 2002 8:50 am    Post subject: URGENT: Java and C++ Interoperability Design Issue Reply with quote

Apprentice

Joined: 10 Jun 2002
Posts: 47
Location: New York City

Hi,

We have a C application and a Java application that need to exchange messages on several IBM MQ 5.1 queues. What's the best way to achieve this?

option 1. if both Java and C app use MQI protocol to put and get messages, do we have to consider Java and C++ data type conversions and other issues ?

option 2. if we let Java app to use JMS to interact with the queues, meanwhile still let C app to use MQI. is it going to solve interop problem ? what's the downside of doing this ?

option 3. ?

Thanks in advance
Sky
Back to top
View user's profile Send private message
skytorch
PostPosted: Thu Nov 07, 2002 10:25 am    Post subject: Reply with quote

Apprentice

Joined: 10 Jun 2002
Posts: 47
Location: New York City

One more thing -

If I've a data structure in Java, is there a way for C or C++ application to be able to use a similar data structure (such as structure). And vice versa. Basically, can I do anything more than passing around tag-value pairs ?

Thanks in advance.

Sky
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Thu Nov 07, 2002 9:25 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3253
Location: London, ON Canada

Sure, you can pass 'C' structures between a 'C' program and a Java program. This is better than tag-value pairs.

But if you are going to use tag-value pairs, then why don't you use XML instead?

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
skytorch
PostPosted: Fri Nov 08, 2002 6:44 am    Post subject: Reply with quote

Apprentice

Joined: 10 Jun 2002
Posts: 47
Location: New York City

Roger,

We're concerned with performance of XML over tag-value pair since we're doing a trading system.

If you've a C structure like this:

struct User {
char* name;
int id;
char* address;
}

how do you get it from Java MQMessage API. is it represented as a Java Object imbeded in the MQMessage ? If so, what's the Java representation of this C struct ?

Also, if you've a java object imbeded in a MQMessage sent by a Java application to a queue like this:

class Firm {
String name;
String location;
int employees;

public String getName();
}

How do you get this info in your C application that is retrieving messages from this same queue ?

Thanks.
Sky
Back to top
View user's profile Send private message
skytorch
PostPosted: Tue Nov 12, 2002 8:33 am    Post subject: Reply with quote

Apprentice

Joined: 10 Jun 2002
Posts: 47
Location: New York City

hello, are those mq experts (duncan, potkay, yoda) still with this forum? i don't see replies that i used to see a lot. what's going on.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Nov 12, 2002 10:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3253
Location: London, ON Canada

I swear I posted an answer the other day. Hummm.

I would do neither. Do not put a class object as a message unless the receiving application is written in Java (way, way too much work).

Secondly, do not put 'C' pointers in a message - it won't do the receiving application any good (e.g. char* name; and char* address; are pointers).

Use something like:
Code:
struct User {
   char name[50];
   char id[12];
   char address[50];
}


Convert your integer to a string before you send it. That way you can mark the message format as "MQSTR". Therefore, you can get the queue manager to convert the message between different platform types.

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » URGENT: Java and C++ Interoperability Design Issue
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.