[jboss-user] [JBoss Cache Users] - Re: Small road map question
Let's say I am working on a trading application, ask orders against bid orders, when there is an order match there is a deal. The point is that I can't take any chance there. If the order is there I don't want any other cache instance to pull it out. I prefer all the instances to lock, proceed and then go on. The safety factor is very important here. Regards Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269303#4269303 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269303 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Cache Users] - Small road map question
Hi JBoss Cache fellows, I see that pessimistic locking is being deprecated for MVCC scheme, the question is why ? I do understand that pessimistic lock scheme has very poor performance but in some case you don't have any other option. Why to deprecate ? Why it can't be left as an option ? Thank in advance Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266970#4266970 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266970 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Cache Users] - Re: Null element in the Vector
Here is the output of simple concurrency test Thread: [44] pushing | Thread: [45] poping | Thread: [45] | [null], | Thread: [45] poping | Thread: [44] | [23], | Thread: [44] pushing | Thread: [44] | [23], [23], | Thread: [45] | [null], | Thread: [44] pushing | Thread: [44] | [23], [23], [23], | Thread: [44] pushing | Thread: [44] | [23], [23], [23], [23], | Thread: [44] pushing | Thread: [44] | [23], [23], [23], [23], [23], | Thread: [44] pushing | Thread: [44] | [23], [23], [23], [23], [23], [23], | Thread: [45] poping | Thread: [44] pushing | Thread: [45] | [23], [23], [23], [23], [null], | Thread: [45] poping | Thread: [45] | [23], [23], [23], [null], [null], [23], | Thread: [45] poping | Thread: [44] | [null], [null], [null], [null], [null], [23], [23], | Thread: [44] pushing | Thread: [45] | [23], [23], [null], [null], [23], [null], | Thread: [45] poping | Thread: [45] | [23], [null], [null], [23], [null], [null], [23], Here is the code of the test: | | | | package org.galtstreet.cache.test; | | import java.util.Properties; | | import javax.naming.Context; | import javax.naming.InitialContext; | import javax.naming.NamingException; | import javax.resource.NotSupportedException; | import javax.transaction.SystemException; | import javax.transaction.UserTransaction; | | import junit.framework.TestCase; | | import org.galtstreet.exchangeboard.trying.WrappedQueue; | import org.jboss.cache.config.Configuration.CacheMode; | import org.jboss.cache.factories.UnitTestConfigurationFactory; | import org.jboss.cache.lock.IsolationLevel; | import org.jboss.cache.pojo.PojoCache; | import org.jboss.cache.pojo.PojoCacheFactory; | | | public class SimpleConcurrencyTest extends TestCase{ | | | |PojoCache cache1; | | protected void setUp() throws Exception { | | Properties prop = new Properties(); | prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory"); | boolean toStart = false; | | | | cache1 = PojoCacheFactory.createCache(UnitTestConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart); | cache1.getCache().getConfiguration().setSyncCommitPhase(true); | | cache1.getCache().getConfiguration().setLockParentForChildInsertRemove(true); | cache1.getCache().getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE); | cache1.start(); | } | | | UserTransaction getTransaction() throws SystemException, NotSupportedException, NamingException | { | Properties prop = new Properties(); | prop.put(Context.INITIAL_CONTEXT_FACTORY, | "org.jboss.cache.transaction.DummyContextFactory"); | return (UserTransaction) new InitialContext(prop).lookup("UserTransaction"); | } | | | public void testWrappedQueue(){ | | WrappedQueue queue = new WrappedQueue(); | | cache1.attach("queue-1", queue); | | | ProducerThread pt = new ProducerThread(queue); | pt.start(); | | | ConsumerThread ct = new ConsumerThread(queue); | ct.start(); | | sleeping(12); | | } | | | | class ConsumerThread extends Thread{ | | WrappedQueue queue = null; | | public ConsumerThread(WrappedQueue queue) { | this.queue = queue; | } | | @Override | public void run() { | | while (true){ | | UserTransaction ut = null; | | try { | ut = getTransaction(); | ut.begin(); | }catch (Throwable th){ | th.printStackTrace(); | } | | System.out.println("Thread: [" + this.getId() + "] poping "); | queue.popInteger(); | | System.out.println("Thread: [" + this.getId() + "] \n" + queue.toString() ); | sleeping(500); | | | try { | ut.commit(); | }ca
[jboss-user] [JBoss Cache Users] - Null element in the Vector
I am chasing after a strange issue in pojo cache: There is a Vector that I am using it as a queue one Thread is pushing things into the tail and the other poping the head of the Vector. The Vector is being aspectize with the following configuration (pojocache-aop.xml): | | | | | | | | | | | | | | | | |org.jboss.cache.pojo.impl.ArrayInterceptable | | | | | | | I have tried different cache configurations, the last one is like this: | Configuration config = new Configuration(); | config.setTransactionManagerLookupClass( JBossTransactionManagerLookup.class.getName() ); | config.setIsolationLevel(IsolationLevel.SERIALIZABLE); | config.setCacheMode(CacheMode.REPL_SYNC); | config.setLockAcquisitionTimeout(3); | config.setClusterName("DefaultPartition"); | config.setConcurrencyLevel(5000); | config.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC); | | The vector is placed inside the pojo cache on JBoss 5.1.0 GA. And then I see the following problem happens from time to time: I see null elements apears inside the vector when I have cirtanly no code that puts it there and by inspecting the logs I see that it happens when there is concurrent activity on the Vector. Before I am going to open a bug on it, I would like to know if there is someone else that has similar expirience and maybe know about any work around to prevent this behavior. Regards Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266892#4266892 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266892 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - Re: Connection pool for ClusteredConnectionFactory, how to ?
"timfox" wrote : If you're using a stateless session bean that means you're running on a server so you can just use JCA pooling. | | There are various wiki pages on this. You mean: to pool JMS stub with JCA it interesting , have you tried it ? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262095#4262095 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262095 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - Re: Connection pool for ClusteredConnectionFactory, how to ?
"gaohoward" wrote : | Q1: | JBM doesn't provide connection pooling. You need to pool the connection yourself or using some 3rd party lib (if any). | | Q2: | Because JBM doesn't pool connections, so there is no place for such configurations. | | Howard | Thanks, I think I can implement this with stateless bean which will keep the connection, and will reload it if it is down. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262090#4262090 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262090 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - Connection pool for ClusteredConnectionFactory, how to ?
Hi Fellows, I am trying to gather some information of connection pooling for JMS. Let's say I have the following architecture: FrontNode --->Node1 <---> Node2 FrontNode gets HTTP trafic and forwards it to Node1, Node2 - cluster over JMS protocol. The system works great but the question is regarding pooling connectionFactory.createConnection(): Basicaly that code runs on FrontNode: Queue queue = (Queue) initialContext.lookup("/queue/MyQueue"); ConnectionFactory cf = (ConnectionFactory) initialContext .lookup("/MyClusteredConnectionFactory"); connection = cf.createConnection(); Obviously, the create connection is very heavy opperation because it creates the actual socket for the message. Two questions: 1) How to configure the pool for the create connection operation ? 2) The connection factory is been accessed as a stub because it been recieved over JNDI so where the configuration for the pool should be applied on the Node1 or on FronNode ? *) I am using JBoss 5.1 GA View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259095#4259095 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259095 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering] - Re: TCPPING configuration
Hi Brian , I found your post here: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=157684 it solved almost all my problems. Thanks a lot Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258806#4258806 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258806 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering] - TCPPING configuration
Trying to configure a cluster that uses only TCP but without a success, the ports been assigned correct to the transport but the nodes are not trying to discover each other, any advice ?. Here is my configuration: 1) two 5.1 nodes on localhost. 2) run commands: jboss-5.1.0.GA-node1\bin\run.bat -Djboss.service.binding.set=ports-02 -c all jboss-5.1.0.GA-node2\bin\run.bat -Djboss.service.binding.set=ports-03 -c all 3) Node - 1 Node - 2 View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258570#4258570 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258570 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - Re: ClusteredConnectionFactory
I think I am over that issue, the problem was that when I look-up from the server to ClusterConnectionFactory it actually gives me the local instance and it doesn't matter what addresses been mentioned in the java.naming.provider.url. So I have solved that problem by creating another CF on the distant cluster with different JNDI binding. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258505#4258505 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258505 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - ClusteredConnectionFactory
Hi, I try to cook load balancing through JMS connection factory here is two questions to the pros: 1) When I use it from the stand alone it really works, which means it creates connection to each node in it's turn. The question is when I get the object - JBossConnectionFactory I see it encapsulates ClientClusteredConnectionFactoryDelegate object which is reasonable but the data member supportLoadBalancing is false, the question is why ? 2) The second question is when I try the same stuff not from the stand alone to a server but from server to server it doesn't work the connection been created each time to one node despite the fact there is two nodes in the cluster, again the question is what can be the problem ? Here is all the details: I am using JBoss 5.1 GA all - configuration, two nodes - ports binding 02 and 03. on the client here is the code that gets the factory and creates the connection: | Connection connection = null; | InitialContext initialContext = null; | | | Hashtable jndiParameters = new Hashtable(); | jndiParameters.put("java.naming.provider.url", "127.0.0.1:1300,127.0.0.1:1400"); | jndiParameters.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); | jndiParameters.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); | | | initialContext = new InitialContext(jndiParameters); | | Queue queue = (Queue) initialContext.lookup("/queue/DLQ"); | | ConnectionFactory cf = (ConnectionFactory) initialContext | .lookup("/ClusteredConnectionFactory"); | | for (Integer i = 0; true; i++) { | try { | | | connection = cf.createConnection(); | | Session session = connection.createSession(false, | Session.AUTO_ACKNOWLEDGE); | MessageProducer producer = session.createProducer(queue); | | String myString = new String(i.toString()); | ObjectMessage objectMessage = session.createObjectMessage(myString); | | producer.send(objectMessage); | | } catch (Throwable th){ | | th.printStackTrace(); | continue; | | } finally { | if (connection != null) { | connection.close(); | } | } | } | } | | on the server I use the same principle. Thanks in advance Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258436#4258436 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258436 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - Re: HA JNDI connection
btw that zip file seams to be corrupted I got the test samples directly from SVN View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257784#4257784 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257784 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - Re: HA JNDI connection
Hi, Basically you are right but I have published it here because I am trying JBM samples and want to fix it. Now the problem it self: I have started the all configuration of jboss 5.1 GA and mbean shows that the service is there and listening, do you think I need to config something else ? Thanks in advance Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257782#4257782 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257782 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Messaging Users] - HA JNDI connection
Hi, I have tried to run HA-JNDI sample the question is what port to use for java.naming.provider.url the one that is specified in Naming service usually 1099 or the port that is specified in HAJNDI service usually 1100. I have tried both options: if I connect to the Naming service port the sample is working but doesn't survive a fail over on the other hand I can't connect to the HAJNDI service port. I think I am missing something, please advice. Thanks in advance. Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257709#4257709 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257709 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JNDI and Naming] - Re: HA JNDI , failed to connect from stand alone
One more thing also seams strange: the fact that I can connect and lookup to Naming service port, specified in service=Naming but it doesn't supports fail over. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257700#4257700 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257700 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JNDI and Naming] - HA JNDI , failed to connect from stand alone
Hi, I am trying to connect from a stand alone program to a 2 nodes cluster started on binding set ports-02 and ports-03, all the start and node discovery seams to be ok, but the JNDI lookup fails. here is the client code: | Connection connection = null; | InitialContext initialContext = null; | | | Hashtable jndiParameters = new Hashtable(); | jndiParameters.put("java.naming.provider.url", "127.0.0.1:1102,127.0.0.1:1103"); | jndiParameters.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); | jndiParameters.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); | | | initialContext = new InitialContext(jndiParameters); | | | ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); I get the following: | Exception in thread "Main Thread" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:1102,127.0.0.1:1103 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /127.0.0.1:1103 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /127.0.0.1:1103 [Root exception is java.net.ConnectException: Connection refused: connect]]] | at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763) | at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693) | at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686) | at javax.naming.InitialContext.lookup(InitialContext.java:392) | at HAJNDISample.main(HAJNDISample.java:32) | Very strange, I have checked the MBean configurations in JMX and it seams to be correct. Thanks in advance Roman View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257635#4257635 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257635 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user