|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with MbGlobalMapSessionPolicy in erternal Java File |
« View previous topic :: View next topic » |
Author |
Message
|
mahesh2069 |
Posted: Fri Jan 10, 2014 6:54 am Post subject: Problem with MbGlobalMapSessionPolicy in erternal Java File |
|
|
Centurion
Joined: 26 Jun 2013 Posts: 103
|
Hi All,
I need to work on MbGlobalMapSessionPolicy in external file to remove cache automatically from Grid.
In Java Compute Node , This MbGlobalMapSessionPolicy class works correct ,coming to java class it throws Throwable error.
Can we use MbGlobalMapSessionPolicy in .java file , like MbGlobalMap?
Help me ....  _________________ Thanks & Regards
Mahesh Mediboyina
WMB Developer |
|
Back to top |
|
 |
mahesh2069 |
Posted: Fri Jan 10, 2014 7:05 am Post subject: I got following Exception |
|
|
Centurion
Joined: 26 Jun 2013 Posts: 103
|
No class definition found..
Code: |
java.lang.NoClassDefFoundError: com.ibm.broker.trace.Trace
|
_________________ Thanks & Regards
Mahesh Mediboyina
WMB Developer |
|
Back to top |
|
 |
stoney |
Posted: Mon Jan 13, 2014 2:56 am Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
It sounds like you are trying to use MbGlobalMap and MbGlobalMapSessionPolicy in an external Java application.
This is not supported and as you have discovered will not work.
Those classes can only be used in Java code deployed to an execution group. |
|
Back to top |
|
 |
muthu_tek |
Posted: Thu Apr 17, 2014 11:31 pm Post subject: |
|
|
Apprentice
Joined: 21 Jan 2010 Posts: 36 Location: Coimbatore,India
|
stoney is correct.
You can create static Java wrappers for common global cache tasks, such as getting/inserting a String value from a given Map. You can then call these Java methods from within ESQL and the Mapping node. Making the cache available natively from across the programming interfaces is the long-term goal
Java Code :
Code: |
package com.muthu.iib.integration.services;
import com.ibm.broker.plugin.MbException;
import com.ibm.broker.plugin.MbGlobalMap;
import com.ibm.broker.plugin.MbGlobalMapSessionPolicy;
public class InvokeCache {
public static String callCache(String Key,String Value ){
MbGlobalMap authMap;
try {
authMap = MbGlobalMap.getGlobalMap("authMap");
MbGlobalMap.getGlobalMap("authMap",new MbGlobalMapSessionPolicy(10));
String test = (String)authMap.get(Key);
if (test == null) {
authMap.put(Key, Value);
} else {
authMap.update(Key, Value);
}
} catch (MbException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
} |
ESQL Code
Code: |
SET cacheValue = callCache("100","Marimuthu Udayakumar From India");
CREATE PROCEDURE callCache(IN requestId CHARACTER, IN payLoad CHARACTER)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.muthu.iib.integration.services.InvokeCache.callCache"; |
 _________________ Thanks and Yours,
Marimuthu Udayakumar |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|