public static void scheduleBackupNow(String id) throws Exception { SalesforceOrg org = dbUtils.findOrganizationById(id); org.setLastBackupStatus("Scheduled"); dbUtils.upsert(org); JedisPool pool = null; Jedis jedis = null; try { pool = poolFactory.getPool(); jedis = pool.getResource(); ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); String msgJson = mapper.writeValueAsString(org); jedis.rpush(DotVersionConstants.BACKUP_QUEUE_NAME, msgJson); } finally { if (pool != null && jedis != null) { pool.returnResource(jedis); } } backups(); }