The ClojureWerkz Blog

News and updates about ClojureWerkz projects

Meltdown 1.0.0-beta10 Is Released

TL;DR

Meltdown is a Clojure interface to Reactor, an asynchronous programming, event passing and stream processing toolkit for the JVM.

1.0.0-beta10 is a development milestone with minor improvements.

Changes between 1.0.0-beta9 and 1.0.0-beta10

Reactor Update

Reactor is updated to 1.1.0.M3.

2-arity of clojurewerkz.meltdown.reactor/on is Removed

Reactor 1.1.0.M3 no longer supports default key (selector), so 2-arity of clojurewerkz.meltdown.reactor/on was removed.

Clojure 1.6

Meltdown now depends on org.clojure/clojure version 1.6.0. It is still compatible with Clojure 1.4 and if your project.clj depends on a different version, it will be used, but 1.6 is the default now.

Changes between 1.0.0-beta8 and 1.0.0-beta9

Consumer and Selector Introspection

clojurewerkz.meltdown.selectors/selectors-on is a new function that returns a list of selectors registered on a reactor:

1
2
3
4
5
6
(require '[clojurewerkz.meltdown.reactor   :as mr])
(require '[clojurewerkz.meltdown.selectors :as ms :refer [$])

(let [r   (mr/create)]
  (mr/on r ($ "a.key) (fn [evt]))
  (ms/selectors-on r))

clojurewerkz.meltdown.consumers/consumer-count is a new function that returns a number of consumers registered on a reactor:

1
2
3
4
5
6
7
(require '[clojurewerkz.meltdown.reactor   :as mr])
(require '[clojurewerkz.meltdown.selectors :refer [$])
(require '[clojurewerkz.meltdown.consumers :as mc])

(let [r   (mr/create)]
  (mr/on r ($ "a.key) (fn [evt]))
  (mc/consumer-count r))

Change log

Meltodwn change log is available on GitHub.

Meltdown is a ClojureWerkz Project

Meltdown is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Elastisch, a Clojure client for ElasticSearch
  • Monger, a Clojure MongoDB client for a more civilized age
  • Cassaforte, a Clojure Cassandra client
  • Titanium, a Clojure graph library
  • Neocons, a client for the Neo4J REST API
  • Quartzite, a powerful scheduling library

and several others. If you like Meltdown, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About the Author

Michael on behalf of the ClojureWerkz Team

Elastisch 2.0.0-beta4 Is Released

TL;DR

Elastisch is a battle tested, small but feature rich and well documented Clojure client for ElasticSearch. It supports virtually every Elastic Search feature and has solid documentation.

2.0.0-beta4 is a preview release of Elastisch 2.0, which focuses on the new features in ElasticSearch 1.0 and 1.1 as well as some API refinements.

Changes between Elastisch 2.0.0-beta3 and 2.0.0-beta4

Options As Maps

Elastisch has tranditionally accepted options as (pseudo) keywrod arguments, e.g.

1
(doc/search index-name mapping-type :query (q/term :biography "say"))

Starting with 2.0.0-beta4, passing a single map of arguments is now also supported by nearly all document, index, admin and percolation functions:

1
(doc/search index-name mapping-type {:query (q/term :biography "say")})

As a new design rule, all new API elements (e.g. aggregations) will accept a single map of options.

GH issue: #59.

Percolation of Existing Documents (REST API)

REST API client now supports percolation of existing documents:

1
2
3
(require '[clojurewerkz.elastisch.rest.percolation :as pcl])

(pcl/percolate-existing "articles" "article" "123")

Changes between Elastisch 2.0.0-beta2 and 2.0.0-beta3

ElasticSearch Client Update

ElasticSearch client has been upgraded to 1.1.0.

Clojure 1.6

Elastisch now depends on org.clojure/clojure version 1.6.0. It is still compatible with Clojure 1.4 and if your project.clj depends on a different version, it will be used, but 1.6 is the default now.

Type Exists Operation

types-exists support in both rest and native clients:

1
2
3
(require '[clojurewerkz.elastisch.rest.index :as esi])

(esi/type-exists? "an-index" "a-type")

Contributed by Halit Olali.

Full Change Log

Elastisch change log is available on GitHub.

Thank You, Contributors

Kudos to Halit Olali, shmish111, and Richie Vos for contributing to this release.

Elastisch is a ClojureWerkz Project

Elastisch is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Monger, a Clojure MongoDB client for a more civilized age
  • Cassaforte, a Clojure Cassandra client
  • Titanium, a Clojure graph library
  • Neocons, a client for the Neo4J REST API
  • Welle, a Riak client with batteries included
  • Quartzite, a powerful scheduling library

and several others. If you like Elastisch, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About the Author

Michael on behalf of the ClojureWerkz Team

Langohr 2.9.0 Is Released

TL;DR

Langohr is a small Clojure RabbitMQ client.

2.9.0 is a minor feature release.

Changes between Langohr 2.8.x and 2.9.0

Configurable Default and Per-Operation Options in HTTP API Client

Most HTTP API client functions now have an additional optional arguments, which is a map of options passed to clj-http functions. This lets you fine tune certain HTTP requests as needed.

In addition, langohr.http/connect! now accepts one more argument which serves as default HTTP client options merged with the options provided per langohr.http function call:

1
2
3
4
5
6
7
8
9
10
11
12
(require '[langohr.http :as hc])

;; non-20x/30x statuses will now throw exceptions
(hc/connect! "http://127.0.0.1:15673" "guest" "guest" {:throw-exceptions true})

;; disable throwing exceptions for an individual operation,
;; because 404 is an expected HTTP response in this case
(hc/vhost-exists? "myapp-production" {:throw-exceptions false})
;= false

;; disabling peer verification for HTTPS requests
(hc/connect! "http://127.0.0.1:15673" "guest" "guest" {:insecure? true})

Thread Factory Customization

It is now possible to customize a java.util.concurrent.ThreadFactory used by Langohr connections. The factory will be used to instantiate all threads created by the client under the hood.

The primary use case for this is running on Google App Engine which prohibits direct thread instantiation and requires apps to use thread manager (or thread factory) from GAE SDK instead.

To provide a custom thread factory, pass it as :thread-factory to langohr.core/connect. To reify a thread factory with a Clojure function, use langohr.core/thread-factory-from:

1
2
3
4
5
6
(require '[langohr.core :as lc])

(let [tf (lc/thread-factory-from
            (fn [^Runnable r]
              (Thread. r)))]
  (lc/connect {:thread-factory tf}))

com.rabbitmq.client.TopologyRecoveryException is Used

Langohr now uses com.rabbitmq.client.TopologyRecoveryException instead of reinventing its own exception to indicate topology recovery failure.

RabbitMQ Java Client Compatibility

A few RabbitMQ Java client interface compatibility issues are resolved.

Change Log

Langohr change log is available on GitHub.

Langohr is a ClojureWerkz Project

Langohr is part of the group of libraries known as ClojureWerkz, together with

  • Elastisch, a minimalistic well documented Clojure client for ElasticSearch
  • Cassaforte, a Clojure Cassandra client built around CQL 3.0
  • Monger, a Clojure MongoDB client for a more civilized age
  • Neocons, a client for the Neo4J REST API
  • Quartzite, a powerful scheduling library

and several others. If you like Langohr, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About The Author

Michael on behalf of the ClojureWerkz Team

Langohr 2.8.1 Is Released

TL;DR

Langohr is a small Clojure RabbitMQ client.

2.8.1 is a minor feature release.

Changes between Langohr 2.7.x and 2.8.1

Client-side Channel Flow Removed

langohr.channel/flow and langohr.channel/flow? were removed. Client-side flow control has been deprecated for a while and was removed in RabbitMQ Java client 3.3.0.

RabbitMQ Java Client Upgrade

RabbitMQ Java client dependency has been updated to 3.3.0.

Clojure 1.6 By Default

Langohr now depends on org.clojure/clojure version 1.6.0. It is still compatible with Clojure 1.4 and if your project.clj depends on a different version, it will be used, but 1.6 is the default now.

We encourage all users to upgrade to 1.6, it is a drop-in replacement for the majority of projects out there.

langohr.http/protocol-ports

langohr.http/protocol-ports is a new function that returns a map of protocol names to protocol ports. The protocols are listed with langohr.http/list-enabled-protocols.

Change Log

Langohr change log is available on GitHub.

Langohr is a ClojureWerkz Project

Langohr is part of the group of libraries known as ClojureWerkz, together with

  • Elastisch, a minimalistic well documented Clojure client for ElasticSearch
  • Cassaforte, a Clojure Cassandra client built around CQL 3.0
  • Monger, a Clojure MongoDB client for a more civilized age
  • Neocons, a client for the Neo4J REST API
  • Quartzite, a powerful scheduling library

and several others. If you like Langohr, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About The Author

Michael on behalf of the ClojureWerkz Team

Propertied 1.2.0 Is Released

TL;DR

Propertied is a tiny Clojure library for working with Java property lists (java.util.Properties).

Changes Between 1.1.0 and 1.2.0

Keywords Support

properties/map->properties now supports keywords keys. properties/properties->map got a new arity that converts keys to keywords:

1
2
3
4
(require '[clojurewerkz.propertied.properties :as p])

;; converts keys to keywords
(p/properties->map props true)

Clojure 1.6 By Default

The project now depends on org.clojure/clojure version 1.6.0. It is still compatible with Clojure 1.4 and if your project.clj depends on a different version, it will be used, but 1.6 is the default now.

We encourage all users to upgrade to 1.6, it is a drop-in replacement for the majority of projects out there.

Full Change Log

Propertied change log is available on GitHub.

Propertied is a ClojureWerkz Project

Propertied is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Monger, a Clojure MongoDB client for a more civilized age
  • Elastisch, a minimalistic Clojure client for ElasticSearch
  • Cassaforte, a Clojure Cassandra client built around CQL
  • Neocons, a client for the Neo4J REST API
  • Welle, a Riak client with batteries included
  • Quartzite, a powerful scheduling library

and several others. If you like Propertied, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About The Author

Michael on behalf of the ClojureWerkz Team

Validateur 2.0.0 Is Released

TL;DR

Validateur is a functional validations library inspired by Ruby’s ActiveModel. Validateur 2.0 is a feature release.

Changes Between 1.7.0 and 2.0.0

Clojure 1.6

Validateur now depends on org.clojure/clojure version 1.6.0. It is still compatible with Clojure 1.4 and if your project.clj depends on a different version, it will be used, but 1.6 is the default now.

Validator Predicates (Guards)

It is now possible to wrap a validator into a function that will check a condition before applying the validator.

To do so, use validate-when:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(require '[validateur.validation])

(defn new?
  [user]
  (nil? (:id user)))

(defn unique-email?
  [user]
  (if-let [existing (find-by-email (:email user)]
    (= (:id user) (:id existing))
    true))

(def validate
  (validation-set
    (presence-of :email)
    (validate :email unique-email? :message "is already taken")
    (validate-when new? (presence-of :password))
    (validate-when #(contains? % :password) (presence-of :password))))

If provided predicate returns false, the validator it guards is not executed.

Contributed by Scott Nelson.

Generic Validator

Generic validator uses a predicate function and attaches errors to specified attribute:

1
2
3
(require '[validateur.validation])

(validate-with-predicate :id unique? :message "ID is not unique")

Contributed by Scott Nelson.

ClojureWerkz Support Dependency Dropped

ClojureWerkz Support is no longer a dependency of Validateur. This makes it easier to use Validateur in ClojureScript projects.

Contributed by hura.

Validation Set Composition

Validateur now supports composition of validation sets. To compose several sets, use validateur.validation/compose-sets:

1
2
3
4
5
6
7
(let [vn (vr/validation-set
           (vr/presence-of :name))
      va (vr/validation-set
           (vr/presence-of :age))
      v  (vr/compose-sets va vn)]
  ;= true
  (vr/valid? v { :name "Joe" :age 28 }))

Contributed by hura.

Full Change Log

Validateur change log is available on GitHub.

Validateur is a ClojureWerkz Project

Validateur is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Monger, a Clojure MongoDB client for a more civilized age
  • Elastisch, a minimalistic Clojure client for ElasticSearch
  • Cassaforte, a Clojure Cassandra client built around CQL
  • Neocons, a client for the Neo4J REST API
  • Welle, a Riak client with batteries included
  • Quartzite, a powerful scheduling library

and several others. If you like Validateur, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About The Author

Michael on behalf of the ClojureWerkz Team

Elastisch 2.0.0-beta2 Is Released

TL;DR

Elastisch is a battle tested, small but feature rich and well documented Clojure client for ElasticSearch. It supports virtually every Elastic Search feature and has solid documentation.

2.0.0-beta2 is a preview release of Elastisch 2.0, which focuses on the new features in ElasticSearch 1.0.

Changes between Elastisch 2.0.0-beta1 and 2.0.0-beta2

(Improved) Aggregation Support

Elastisch 2.0 features multiple convenience functions for working with ElasticSearch aggregations.

clojurewerkz.elastisch.aggregation is a new namespace that contains helper functions that produce various types of aggregations. Just like clojurewerkz.elastisch.query, all of the functions return maps and are optional.

clojurewerkz.elastisch.rest.response/aggregations-from is a new function that returns aggregations from a search response:

1
2
3
4
5
6
7
8
9
10
11
12
(require '[clojurewerkz.elastisch.rest.document :as doc])
(require '[clojurewerkz.elastisch.query :as q])
(require '[clojurewerkz.elastisch.aggregation :as a])
(require '[clojurewerkz.elastisch.rest.response :refer [aggregations-from]])

(let [index-name   "people"
        mapping-type "person"
        response     (doc/search index-name mapping-type
                                 :query (q/match-all)
                                 :aggregations {:min_age (a/min "age")})
        agg          (aggregation-from response :min_age)]
    (is (= {:value 22.0} agg)))

Aggregations support is primarily focused on REST client at the moment.

clj-http Update

clj-http dependency has been upgraded to version 0.9.1.

Full Change Log

Elastisch change log is available on GitHub.

Thank You, Contributors

Kudos to Richie Vos for contributing to this release.

Elastisch is a ClojureWerkz Project

Elastisch is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Monger, a Clojure MongoDB client for a more civilized age
  • Cassaforte, a Clojure Cassandra client
  • Titanium, a Clojure graph library
  • Neocons, a client for the Neo4J REST API
  • Welle, a Riak client with batteries included
  • Quartzite, a powerful scheduling library

and several others. If you like Elastisch, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About the Author

Michael on behalf of the ClojureWerkz Team

Meltdown 1.0.0-beta8 Is Released

TL;DR

Meltdown is a Clojure interface to Reactor, an asynchronous programming, event passing and stream processing toolkit for the JVM.

1.0.0-beta8 is a development milestone with minor improvements.

Changes between 1.0.0-beta7 and 1.0.0-beta8

Key in Event Payload

Meltdown now includes event key when transforming them into Clojure maps.

Example event map:

1
{:data {:event delivered}, :reply-to nil, :headers {}, :key events.dummy, :id #uuid "5714bb01-ac7e-11e3-64b3-6b2c231ad83a"}

Changes between 1.0.0-beta6 and 1.0.0-beta7

Match-All Selector

clojurewerkz.meltdown.selectors/predicate is a new function that creates a match-all selector (a predicate selector that unconditionally returns true).

Predicate Selectors

clojurewerkz.meltdown.selectors/predicate is a new function that creates a predicate selector:

1
2
3
4
5
6
7
8
(require '[clojurewerkz.meltdown.reactor   :as mr])
(require '[clojurewerkz.meltdown.selectors :as ms])

(let [r   (mr/create)
      ;; will filter out events with keys that are
      ;; odd numbers
      sel (ms/predicate even?)]
)

Changes between 1.0.0-beta5 and 1.0.0-beta6

Reactor Update

Reactor is updated to 1.1.0.M2.

Change log

Meltodwn change log is available on GitHub.

Meltdown is a ClojureWerkz Project

Meltdown is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Elastisch, a Clojure client for ElasticSearch
  • Monger, a Clojure MongoDB client for a more civilized age
  • Cassaforte, a Clojure Cassandra client
  • Titanium, a Clojure graph library
  • Neocons, a client for the Neo4J REST API
  • Quartzite, a powerful scheduling library

and several others. If you like Meltdown, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About the Author

Michael on behalf of the ClojureWerkz Team

Langohr 2.7.1 Is Released

TL;DR

Langohr is a small Clojure RabbitMQ client.

2.7.1 is a minor feature release.

Changes between Langohr 2.6.x and 2.7.1

langohr.http/list-enabled-protocols

langohr.http/list-enabled-protocols is a new function that lists the protocols a RabbitMQ installation supports, e.g. "amqp" or "mqtt". Note that this currently does not include WebSTOMP (due to certain technical decisions in RabbitMQ Web STOMP plugin).

Changes between Langohr 2.5.x and 2.6.0

langohr.http/list-connections-from, /close-connections-from

langohr.http/list-connections-from and langohr.http/close-connections-from are two new functions that list and close connections for a given username, respectively:

1
2
3
4
5
6
7
(require '[langohr.http :as hc])

(hc/list-connections-from "guest")
;= a list of connections with username "guest"

;; closes all connections from "guest"
(hc/close-connections-from "guest")

clj-http Upgrade

clj-http dependency has been updated to 0.9.0.

Change Log

Langohr change log is available on GitHub.

Langohr is a ClojureWerkz Project

Langohr is part of the group of libraries known as ClojureWerkz, together with

  • Elastisch, a minimalistic well documented Clojure client for ElasticSearch
  • Cassaforte, a Clojure Cassandra client built around CQL 3.0
  • Monger, a Clojure MongoDB client for a more civilized age
  • Neocons, a client for the Neo4J REST API
  • Quartzite, a powerful scheduling library

and several others. If you like Langohr, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About The Author

Michael on behalf of the ClojureWerkz Team

Elastisch 2.0.0-beta1 Is Released

TL;DR

Elastisch is a battle tested, small but feature rich and well documented Clojure client for ElasticSearch. It supports virtually every Elastic Search feature and has solid documentation.

2.0.0-beta1 is a preview release of Elastisch 2.0, which focuses on ElasticSearch 1.0 compatibility.

Changes between Elastisch 1.4.0 and 2.0.0

ElasticSearch 1.0 Compatibility

Main goal of Elastisch 2.0 is ElasticSearch 2.0 compatibility. This includes minor API changes (in line with ElasticSearch 1.0 API and terminology changes) and moderate internal modifications.

Support for cluster nodes stats and info REST APIs

clojureworkz.elastisch.rest.admin/nodes-info and clojureworkz.elastisch.rest.admin/nodes-stats are new administrative functions that provide access to ElasticSearch cluster stats and node info.

Examples:

1
2
3
4
5
6
7
8
9
(require '[clojurewerkz.elastisch.rest.admin :as admin])

(admin/nodes-stats)
(admin/nodes-stats :nodes "_all")
(admin/nodes-stats :nodes ["node1" "node2"] ["indices" "os" "plugins"])

(admin/nodes-info)
(admin/nodes-info :nodes "_all")
(admin/nodes-info :nodes ["node1" "node2"] ["indices" "os" "plugins"])

See ElasticSearch nodes stats documentation, nodes info page, and node specification page for more info.

Contributed by Joachim De Beule.

Support for _cluster/state REST API

Added (clojureworkz.elastisch.rest.admin/cluster-state & {:as params})

Examples:

1
2
3
4
(require '[clojurewerkz.elastisch.rest.admin :as admin])

(admin/cluster-state)
(admin/cluster-state :filter_nodes true)

See ElasticSearch documentation for more info.

Contributed by Joachim De Beule.

Support for _cluster/health REST API

Added (clojureworkz.elastisch.rest.admin/cluster-health & {:as params})

Example:

1
2
3
4
5
6
(require '[clojurewerkz.elastisch.rest.admin :as admin])

(admin/cluster-health)
(admin/cluster-health :index "index1")
(admin/cluster-health :index ["index1","index2"])
(admin/cluster-health :index "index1" :pretty true :level "indices")

See ElasticSearch documentation for more info.

Contributed by Joachim De Beule.

Support for analyze in REST API client

Added (doc/analyze text & {:as params})

See ElasticSearch documentation for more info.

Examples:

1
2
3
4
5
6
7
(require '[clojurewerkz.elastisch.rest.document :as doc])

(doc/analyze "foo bar baz")
(doc/analyze "foo bar baz" :index "some-index-name")
(doc/analyze "foo bar baz" :analyzer "whitespace")
(doc/analyze "foo bar baz" :tokenizer "keyword" :filters "lowercase")
(doc/analyze "foo bar baz" :index "some-index-name" :field "some-field-name")

Contributed by Joachim De Beule

Query String Escaping

clojurewerkz.elastisch.query/query-string accepts a new option, :escape-with, which is a function that performs escaping of special characters in query string queries.

By default clojurewerkz.elastisch.escape/escape-query-string-characters is used.

Contributed by Ben Reinhart (Groupon).

ElasticSearch Native Client Upgrade

Elastisch now depends on ElasticSearch native client version 1.0.1.

clj-http Update

clj-http dependency has been upgraded to version 0.9.0.

Full Change Log

Elastisch change log is available on GitHub.

Thank You, Contributors

Kudos to Richie Vos for contributing to this release.

Elastisch is a ClojureWerkz Project

Elastisch is part of the group of libraries known as ClojureWerkz, together with

  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Monger, a Clojure MongoDB client for a more civilized age
  • Cassaforte, a Clojure Cassandra client
  • Titanium, a Clojure graph library
  • Neocons, a client for the Neo4J REST API
  • Welle, a Riak client with batteries included
  • Quartzite, a powerful scheduling library

and several others. If you like Elastisch, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

About the Author

Michael on behalf of the ClojureWerkz Team