how can we set JPos to manage Redis?

46 views
Skip to first unread message

arsalan fallah

unread,
Nov 4, 2021, 1:29:09 PM11/4/21
to jPOS Users
Hi everyone.
We have a project which manage with Jpos and Weblogic 12c and wrote multi Thread .we want to save some values in Memory that all of thread see this value,which API and solution do you purpose us?

Alejandro Revilla

unread,
Nov 4, 2021, 1:37:25 PM11/4/21
to jpos-...@googlegroups.com
You may want to take a look at jPOS Space implementation. See http://jpos.org/doc/proguide.pdf

Using the Space, it's very simple to share information among multi-threaded applications.

Think about it as an embedded Redis. If you don't need to share information among multiple JVMs, the Space is your friend.



On Thu, Nov 4, 2021 at 2:29 PM arsalan fallah <fallah....@gmail.com> wrote:
Hi everyone.
We have a project which manage with Jpos and Weblogic 12c and wrote multi Thread .we want to save some values in Memory that all of thread see this value,which API and solution do you purpose us?

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/06a73c94-5825-4a24-a9d8-0efcb4198d89n%40googlegroups.com.

arsalan fallah

unread,
Nov 16, 2021, 2:25:03 AM11/16/21
to jpos-...@googlegroups.com
Hi Alejandro
Thanks a lot  again because I can use the Redis connection pool in our Jpos Project.could I please ask you how can we write a JPos application to be multithread
and how can I allocate an individual Space and Queue  to any thread or increase the capacity of Queue for all of the threads of the project ?

Best regards

Arsalan

murtuza chhil

unread,
Nov 16, 2021, 10:11:19 AM11/16/21
to jPOS Users
Use a transaction manager to make it multi-threaded without having to worry about threads. Request listeners are single threaded so don't do heavy lifting in there, use the listener to hand over the transaction to the transaction manager.
See the jpos programmers guide on some precautions to bear in mind while using transaction participants in your transaction managers.
Spaces are thread safe. If you implement one for redis then you need to be responsible to make it thread safe. Depending on the kind of space you use its either a file based db backing it or it's an in-memory model. There are no size restrictions if you have good expiry times for entries for the space so you don't get an out of memory.
Do see the jpos programmers manual on space usage.

-chhil 

Reply all
Reply to author
Forward
0 new messages