[JBoss Messaging] - about transaction and order
by the.finder
In my case, ineed to process message by order, so i create a Session Bean (Processor) to do that, the code is like following:
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public boolean process() throws BusinessException {
try {
Message message = poll();
if (message != null) {
handle(message);
return true;
}
} catch (Exception e) {
logger.error("error", e);
throw new BusinessException(e);
}
return false;
}
in the function poll(), i just create a MessageConsumer and call receive()ã
in another job, call this session bean like this:
processor.open();
try {
while (processor.process())
;
} finally {
processor.close();
}
and in open() function, i create connection and session, and in close() function i close them.
In my test, we put 10 messages into the queue, and the 5th one will process failed.
I found several strange problems:
1ãmessages after the 5th one was processed
2ãthere are 2 messages left, one is the 5th
How to explain these?
And how to receive 1, 2, 3, 4, and then blocked.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229368#4229368
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229368
17 years
[Installation, Configuration & DEPLOYMENT] - Content-Type for resources from CMS of JBoss Portal
by alberton2009
Hello,
Does anyone know, how to set a content type for resources in CMS ?
I have found file $JBOSS_HOME/server/default/deploy/jboss-web.deployer/conf/web.xml, where I can find:
<!-- ===================== Default MIME Type Mappings =================== -->
| <!-- When serving static resources, Tomcat will automatically generate -->
| <!-- a "Content-Type" header based on the resource's filename extension, -->
| <!-- based on these mappings. Additional mappings can be added here (to -->
| <!-- apply to all web applications), or in your own application's web.xml -->
| <!-- deployment descriptor. -->
|
| <mime-mapping>
| <extension>abs</extension>
| <mime-type>audio/x-mpeg</mime-type>
| </mime-mapping>
| .
| .
| .
Thoug adding any new mime-mapping there seems not to be working for me :| To be clear, I have added there following mapping for 3gp files:
<mime-mapping>
| <extension>3gp</extension>
| <mime-type>video/3gpp</mime-type>
| </mime-mapping>
but, cms portlet is still displaying 3gp files as: application/octet-stream and jboss as is serving them in the same way
Does anyone know how to get rid of that issue ?
Thanks in advace for reply!
Albert
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229361#4229361
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229361
17 years
[Clustering/JBoss] - Re: Communication between nodes
by ekobir
Hi All
I'm struggling to deploy singleton jboss service. Can you provide some feedback what it is wrong with following config file?
The problem is that I'm not able to set TargetName attribute of HASingletonController.
Note: I'm using jboss-eap-5.0--> Supported Alpha Version
11:48:55,438 ERROR [AbstractKernelController] Error installing to Configured: name=xyz:service=TestServiceHASingletonController state=Instantiated mode=Manual requiredState=Configured
java.lang.RuntimeException: Exception setting attribute TargetName on mbean xyz:service=TestServiceHASingletonController
Caused by: javax.management.InvalidAttributeValueException: Set attribute has class class javax.management.ObjectName loaded from null that is not assignable to attribute class class javax.management.ObjectName loaded from BaseClassLoader@15b9a0c
| public interface TestServiceMBean extends HAServiceMBean {
|
| public void startSingleton();
|
| public void stopSingleton();
|
| }
|
|
| public class TestService extends HAServiceMBeanSupport
| implements TestServiceMBean {
|
| private static Logger logger = Logger.getLogger(
| TestService.class);
|
|
| @Override
| public void startSingleton() {
| logger.info("Start Singleton Service");
| }
|
| @Override
| public void stopSingleton(){
| logger.info("Stop Singleton Service");
| }
|
| @Override
| protected void createService() throws Exception {
| super.createService();
| logger.info("Create Service");
| }
|
| @Override
| protected void startService() throws Exception {
| super.startService();
| logger.info("Start Service");
| }
|
| @Override
| protected void stopService() throws Exception {
| super.stopService();
| logger.info("Stop Service");
| }
|
| @Override
| protected void destroyService() throws Exception {
| super.destroyService();
|
| logger.info("Destroy Service");
| }
| }
|
| <?xml version="1.0" encoding="UTF-8" ?>
| <server>
| <mbean
| code="xyz.TestService"
| name="xyz:service=TestService">
| <!--
| I tried to inject HAPartition like below as setting ClusteredPartition is deprecated,
| unfortunately it didnt work
|
| <depends>HAPartition</depends>
| <property name="HAPartition"><inject bean="HAPartition"/></property>
| -->
|
| <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">
| jboss:partition=${jboss.partition.name:DefaultPartition},service=HAPartition
| </depends>
| </mbean>
|
| <mbean code="org.jboss.ha.singleton.HASingletonController"
| name="xyz:service=TestServiceHASingletonController">
| <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">
| jboss:partition=${jboss.partition.name:DefaultPartition},service=HAPartition
| </depends>
| <depends optional-attribute-name="TargetName">
| xyz:service=TestService
| </depends>
| <attribute name="TargetStartMethod">startSingleton</attribute>
| <attribute name="TargetStopMethod">stopSingleton</attribute>
| </mbean>
| </server>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229359#4229359
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229359
17 years