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 » WebSphere Message Broker (ACE) Support » c plugin

Post new topic  Reply to topic
 c plugin « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Mon May 21, 2012 6:41 am    Post subject: c plugin Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

HI to All,

In c pluging I am trying read a file and return 1 rec at a time.
Trying to read next record where left file-pointer on prev call to function, and avoid re-open file every time.

In "evaluate" do I need to keep
static FILE *FilePtr;
or save the pointer in NODE_CONTEXT ?

How do I caonvert file pointer to CNI_TYPE_?????

Thanks,
MA
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Vitor
PostPosted: Mon May 21, 2012 6:55 am    Post subject: Re: c plugin Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

scravr wrote:
In c pluging I am trying read a file and return 1 rec at a time.


And you can't use the inbuilt file nodes because....?

scravr wrote:
Trying to read next record where left file-pointer on prev call to function, and avoid re-open file every time.


I'm unconvinced you can.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
scravr
PostPosted: Mon May 21, 2012 6:59 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

1. Will "static FILE *fp" be kept between c-plugin node iterations?
2. How can I convert *fp and keep in "NODE_CONTEXT????"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
mqjeff
PostPosted: Mon May 21, 2012 7:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why, exactly, are you using the C APIs to do this?
Back to top
View user's profile Send private message
scravr
PostPosted: Mon May 21, 2012 7:08 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

trying to get better performance.
File-Read node is very slow.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Vitor
PostPosted: Mon May 21, 2012 7:26 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

scravr wrote:
File-Read node is very slow.


No it isn't. Especially as it's doing what you're trying to code (or will end up coding).

Also if you're repeatedly reading the same file why not use the FileInput node? FileRead is intended to pick a single record out of a file rather than do repeated reads (which may be why you're finding it slow).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon May 21, 2012 7:28 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

scravr wrote:
1. Will "static FILE *fp" be kept between c-plugin node iterations?


I don't believe so. I'd certainly hate to rely on it

scravr wrote:
2. How can I convert *fp and keep in "NODE_CONTEXT????"


I don't believe you can.

Others with more plugin experience may wish to correct me. I'd use the built-ins for this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon May 21, 2012 7:32 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's going to be relatively easier to code this in Java than in C.

The C node API does run in a C++ context, so you can indeed create your own C++ object to hold all the things you need, but you still need to be aware of which instance of your object is tied to which instance of the message flow that's being invoked from the evaluate().

The C++ implementation will indeed run faster than java, but unless you're trying to process millions of records a second, it's not likely you'll see a measurable gain using C++. If you are trying to process millions of records a second, you shouldn't be writing them to a file in the first place.
Back to top
View user's profile Send private message
scravr
PostPosted: Mon May 21, 2012 8:02 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

Dose anyone have a sample of how to get & set values to/from env.var. elaments passed from ESQL?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
scravr
PostPosted: Mon May 21, 2012 8:19 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

does c has similare function to JAVA's getFirstElementByPath ?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » c plugin
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.