Category: Software Engineering
-
Restore a Deleted WordPress Menu from a Database Backup
Unlike most types of WordPress content, menus unfortunately have no “trash” concept. When they’re removed, they’re gone for good. We recently ran into an issue where a large set of menus were accidentally nuked… If you don’t have a recent database backup, your only option is to manually create them using historical reference points like…
-
Apache Camel: camel-http, Apache HttpClient, and Retry Attempts
Morning! Here’s a quick tip on camel-http and proper retry logic within error handling. Under the hood, camel-http uses Apache’s HttpClient, which provides its own retry logic by default. Adding Camel’s onException redeliveries on top of that ends up multiplying the attempts. By default, the above will actually be reattempted 9 times, not 3! So, we…
-
Apache Camel: Tips & Caveats (from the trenches)
While working with a new client on some Camel-based microservices, I’ve been trying my best to keep a list of caveats and potential issues that occasionally pop up. Camel’s integration patterns and components are extremely powerful and include many bells and whistles. But unfortunately, that flexibility can also get in the way… Without further ado,…
-
Hibernate ORM, jOOQ, HikariCP, Transactions, and Spring: An SQL / CQRS Tutorial
When it comes to interacting with relational databases, citizens of the Java world tend to be in one of two camps. Lately, the rift continues to widen. Folks miss an important point: ORM was never meant to be used for everything! It is a tool to be used where applicable. Can it be used as a complete abstraction or replacement for everything…
-
Apache Camel: Processors Should NEVER Be Stateful
If you have experience with Apache Camel, this one might sound a little obvious. But, it has recently come up a few times, so it’s worth mentioning. As an example, say you have a route that iterates over paged data and does something with it, and you therefore need to keep track of the pagination.…
-
Apache Karaf on Vagrant (example Vagrantfile)
If you have a team developing OSGi applications for Apache Karaf, Vagrant provides an easy way to ensure everyone is testing local deployments in a consistent context. Vagrant is a little like Docker, using a layered approach to build up virtual environments. In this case, we create an Ubuntu “box”, running on a VirtualBox VM,…
-
Apache Camel: Throw Exception from Sub-Route to Previous Route
By default, each Apache Camel route has its own error handler, meaning each independently catches and handles Exceptions thrown within it. But, what if a “parent route” needs to catch and handle Exceptions thrown by a sub-route? Here’s one approach: As is, the above code will result in the DefaultErrorHandler handling the Exception, but within fooB!…
-
Find Transaction Leaks in Wildfly and JCA
Here’s a quick tip: the easiest way to find transaction leaks in Wildfly/JCA. In standalone.xml’s JCA subsystem, change <cached-connection-manager/>to<cached-connection-manager debug=”true”/> That will automatically close un-closed JCA connections and spit out a nice warning/stacktrace, showing exactly where the transaction was opened.
-
How to Issue Bulk Refunds through the Stripe API
Today was not a good day. In short, a nonprofit’s online donation form was hit 1,285 times in an attempt to validate stolen credit cards. Unfortunately, 120 of those succeeded, meaning our Stripe account had over $600 in fraudulent donations. I needed a quick way to fully refund those charges, but in bulk. Through the Java…
-
Tutorial: Spring + Hibernate + HikariCP
HikariCP is newer JDBC connection pool, but has already gained a large following. And for good reason! It’s lightweight, reliable, and performant. We recently added it as a core module to Hibernate ORM: hibernate-hikaricp (will be released in ORM 4.3.6 and 5.0.0). However, I wanted to try and replace C3P0 within NeighborLink’s new web platform. …
-
Man vs. JIRA: The 3,000+ Issue Tracker Fight
What do you get from a 10+ year old open source framework, thousands and thousands of users within a wide range of roles, and tremendous complexity? A JIRA project with over 3,000 unresolved tickets, ranging from the brand-new to a stale 8+ years. Welcome to Hibernate ORM. Is the large number indicative of low software…
-
Dear Open Source Project User: Quit Being A Jerk
A few weeks ago, this article was circulating around in HackerNews and other social media: Dear Open Source Project Leader: Quit Being A Jerk I 100% agree with the author’s points. Sometimes, open source project leaders can be seriously rude and elitist. Ironically, the same projects beg for contributors “no matter the skill level or…