kandi X-RAY | persistent-queue Summary
kandi X-RAY | persistent-queue Summary
This project provides a simple reliable, persistent queue. It is meant to be used within a single jvm to decouple event processing from external resources like e.g. a database or webservice. So when such an external resource is not available clients shall be able to continue their work and produced events/messages are being processed as soon as the external resource is available again. The current version uses jackson to serialize pojos. This is going to be extended so that other serialization mechanisms can be used (e.g. standard java serialization for minimal dependencies). For persistence/durability currently Berkeley DB Java Edition is used. Other storage solutions (like e.g. HSQLDB or SQLite) could be added in the future. Any contributions are welcome, so if you're missing s.th. you're invited to submit a pull request or just submit an issue.
Top functions reviewed by kandi - BETA
- Consume the queue
- Peeks the queue
- Process a message
- Deserialize an element
- This method lists a queue
- Returns an iterator over the elements in the queue
- Returns whether this queue is empty
- Returns the size of the queue
- Pushes the given object to the queue
- Pushes an element to the queue
- Clears the queue
- Removes all items from the queue
- Compares two keys
- Returns true if the query is empty
- Retrieves and removes element from the queue
- Peek at the queue
- Create a directory if it does not exist
- Closes this queue
- Get the number of elements in this set
persistent-queue Key Features
persistent-queue Examples and Code Snippets
Trending Discussions on persistent-queue
I need to insert large bulk data to elasticsearch regulary via scala code. When googling, I found to use logstash for large insertion rate but logstash doesn't have any java libraries or Api to call so I tried to connect to it via http client. I don't know it is a good approach to send large data with http protocol or better to use other approaches for example using broker, queues, redis, etc.
I know last versions of logstash(6.X,7.x) enables uses of persistent queue so it can be another solution to use logstash queue but again through http or tcp protocol.
Also note that reliability is the first priority for me since data must not be lost and there should be a mechanism to return response in code so to handle success or failure.
I would appreciate any ideas.
It seems using http is robust and has acknowledgement mechanism based on here but if taking this approach, what http client libs in scala is more appropriate as I need to send bulk data in sequence of key value format and handle response in none-blocking way?...
ANSWERAnswered 2019-May-09 at 00:09
It may sound overkill but introducing a buffering layer between scala code and logstash may prove helpful as you can get rid of heavy HTTP calls and rely on lightweight protocol transport.
Consider adding Kafka between your scala code and logstash for queuing of messages. Logstash can reliably process the messages from Kafka using TCP transport and bulk insert into ElasticSearch. On the other hand, you can put messages into Kafka from your scala code in build (batches) to make the whole pipeline work efficiently.
With that being said, if you don't have a volume in let say 10,000 msgs/sec then you can also consider fiddling around with logstash HTTP input plugin by tweaking threads and using multiple logstash processes. This is to reduce the complexity of adding another moving piece (Kafka) into your architecture.
I would like to implement a persistent queue in Android. Essentially a queue where data is stored until another thread takes it and sends it somewhere. The order in which data is stored or consumed is not important (ex. FIFO, LIFO, LILO, etc). Is there a modern library in Android that supports this?
I found a previous question on SOF but this dates from 2012: How to realize a persistent queue on Android...
ANSWERAnswered 2017-Mar-03 at 01:10
There are a lot of way to do this. You can persist the collection by saving it into a database like SQLite, serialize it as a file and deserialize it when you need it, or you can save it in SharedPreferences of Android.
Anyway there is a cool library called Hawk (https://github.com/orhanobut/hawk) that is a
Secure, simple key-value storage for android
If you take a look at the Hawk source code you can see that it uses SharedPreferences to save data to the disk. It serializes the object you want to persist and saves it into SharedPreferences as a String.
Quotes and images are taken from Hawk github page.
You can find other alternatives here (in the "Persistence" section) : https://github.com/codepath/android_guides/wiki/Must-Have-Libraries
No vulnerabilities reported
You can use persistent-queue like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the persistent-queue component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page