Kafka in Action MEAP V12 Dylan D Scott Viktor Gamov Dave Klein
Kafka in Action MEAP V12 Dylan D Scott Viktor Gamov Dave Klein
Kafka in Action MEAP V12 Dylan D Scott Viktor Gamov Dave Klein
Kafka in Action MEAP V12 Dylan D Scott Viktor Gamov Dave Klein
1. Kafka in Action MEAP V12 Dylan D Scott Viktor
Gamov Dave Klein download
https://textbookfull.com/product/kafka-in-action-meap-v12-dylan-
d-scott-viktor-gamov-dave-klein/
Download more ebook from https://textbookfull.com
2. We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!
Algorithms and Data Structures in Action MEAP V12
Marcello La Rocca
https://textbookfull.com/product/algorithms-and-data-structures-
in-action-meap-v12-marcello-la-rocca/
Real World Cryptography MEAP v12 David Wong
https://textbookfull.com/product/real-world-cryptography-
meap-v12-david-wong/
Scalatra in Action 1st Edition Dave Hrycyszyn
https://textbookfull.com/product/scalatra-in-action-1st-edition-
dave-hrycyszyn/
Quantum Computing In Action MEAP v09 Johan Vos
https://textbookfull.com/product/quantum-computing-in-action-
meap-v09-johan-vos/
3. Apache Pulsar in Action MEAP V04 David Kjerrumgaard
https://textbookfull.com/product/apache-pulsar-in-action-
meap-v04-david-kjerrumgaard/
Graph Databases in Action 1st Edition Dave Bechberger
https://textbookfull.com/product/graph-databases-in-action-1st-
edition-dave-bechberger/
Kubernetes in Action, Second Edition (MEAP V05) Marko
Luksa
https://textbookfull.com/product/kubernetes-in-action-second-
edition-meap-v05-marko-luksa/
Spring in Action - Sixth Edition (MEAP V04) Craig Walls
https://textbookfull.com/product/spring-in-action-sixth-edition-
meap-v04-craig-walls/
Machine Learning Engineering in Action MEAP V04 Ben T
Wilson
https://textbookfull.com/product/machine-learning-engineering-in-
action-meap-v04-ben-t-wilson/
5. MEAP Edition
Manning Early Access Program
Kafka in Action
Version 12
Copyright 2020 Manning Publications
For more information on this and other Manning titles go to
www.manning.com
6. welcome
Thank you for purchasing the MEAP for Kafka in Action!
For me, reading has always been part of my preferred learning style. Part of the nostalgia
is remembering the first practical programming book I ever really read: Elements of
Programming with Perl by Andrew L Johnson. The content was something that registered
with me. I could follow along and it was a joy to work through.
I hope to capture some of that practical content in regards to working with Apache Kafka.
The excitement of learning something new that I had when reading Elements of
Programming with Perl was the same way I felt when I started to work with Kafka for the
first time. Kafka was unlike any other message broker or enterprise service bus (ESB) that I
had used at the time. The speed to get started developing producers and consumers, the
ability to reprocess data, and independent consumers moving at their own speeds without
removing the data from other consumer applications were techniques that solved pain points
I had seen in my own past development and impressed me when I started looking at Kafka.
I see Kafka as changing the standard for data platforms; it can help move batch and ETL
workflows to near real-time data feeds. Since this foundation is likely a shift from past data
architectures that many enterprise users are familiar with, I wanted to take a user from no
prior knowledge of Kafka to the ability to work with Kafka producers and consumers and
also be able to perform basic Kafka developer and admin tasks. By the end of this book, I
also hope you will feel comfortable digging into more advanced Kafka topics such as cluster
monitoring, metrics, and multi-site data replication with your new core Kafka knowledge.
Please remember, these chapters are still works in progress, and will likely change and
hopefully get even better by the time the book is complete. I never used to understand how
simple mistakes could make it into books, but seeing all of the edits, revisions, and deadlines
involved, typos can still make their way into the content and source code. I appreciate your
notes for corrections and patience if you run into anything. Please be sure to post any
questions, comments, or suggestions you have about the book in the liveBook's Discussion
Forum section for Kafka in Action.
I really do hope to make this a useful book and appreciate feedback that you think could
improve future versions as well.
Thanks again for your interest and for purchasing the MEAP!
—Dylan Scott
7. brief contents
PART 1: GETTING STARTED
1 Introduction to Kafka
2 Getting to know Kafka
PART 2: APPLYING KAFKA
3 Designing a Kafka project
4 Producers: Sourcing Data
5 Consumers: Unlocking Data
6 Brokers
7 Topics and Partitions
8 Kafka Storage
9 Administration: Cluster Tools, Logging, and Monitoring
PART 3: GOING FURTHER
10 Protecting Kafka
11 Schema registry
12 A tour of Kafka Streams and KSQL/ksqlDB
APPENDIXES:
A Installation
8. 1
In this chapter, we will:
From a certain point onward there is no longer any turning back. That is the point that must be
reached.
– Franz Kafka
As many companies are facing a world full of data being produced from every angle, they are
often presented with the fact that legacy systems might not be the best option moving forward.
One of the foundational pieces of new data infrastructures that has taken over the IT landscape
has been Apache Kafka. While Kafka, who is quoted above, was addressing something far
different than IT infrastructures, the wording applies to the situation we find ourselves in today
with the emergence of his namesake Apache Kafka. Kafka is changing the standard for data
platforms. It is leading the way to move from Batch and ETL workflows to the near real-time
data feeds. Batch processing, which was once the standard workhorse of enterprise data
processing, might not be something to turn back to after seeing the powerful feature set that
Kafka provides. In fact, it might not be able to handle the growing snowball of data rolling
toward enterprises of all sizes unless something new is approached. With so much data, systems
can get easily inundated with data. Legacy systems might be faced with nightly processing
windows that run into the next day. To keep up with this ever constant stream of data, some with
evolving data, processing this stream of information as it happens is a way to keep up-to-date
and current on the state of the system.
Introduction to Kafka
Introduce why you would want to use Kafka
Address common myths in relation to Hadoop and message systems
Understand Real World Use Cases where Kafka helps power messaging, website
activity tracking, log aggregation, stream processing, and IoT data processing
9. Kafka also is starting to make a push into microservice design. Kafka is touching a lot of the
newest and most practical trends in today’s IT fields as well as making its way into many users
daily work. As a de-facto technology in more and more companies, this topic is not only for
super geeks or alpha-chasers.
Let’s start looking at these features by introducing Kafka itself and understand more about the
face of modern-day streaming platforms.
The Apache Kafka site ( ) defines it as a distributed streaming platform that
kafka.apache.org/intro
has three main capabilites: Provide the ability to publish/subscribe to records like a message
queue, store records with fault-tolerance, and process streams as they occur.
For readers who are not as familiar with queues or message brokers in their daily work, it might
be helpful to discuss the general purpose and flow of a publish/subscribe system. As a
generalization, a core piece of Kafka can be thought of providing the IT equivalent of a receiver
that sits in a home entertainment system.
Figure 1.1 Receiver overview
1.1 What is Kafka?
10. As shown above, digital satellite, cable, and blu-ray players can all connect to this central
receiver. Simplifying of course, you can think of those individual pieces as constantly sending
data in a format that they know about. And unless you have some issues, that flow of data can be
thought as near constant while the movie or cd is playing. The receiver deals with this constant
stream of data and is able to convert it into a usable format for the external devices attached to
the other end; ie. the receiver sends the video on to your television and audio to a decoder as well
as on to speakers.
Figure 1.2 Kafka flow overview
So what does this have to do with Kafka exactly? Kafka has the concepts of sending data from
various sources of information and introducing them into Kafka called Producers. In addition,
Kafka allows multiple output channels that are enabled by Consumers. The receiver can be
thought of as the message brokers themselves that can handle a real-time stream of messages.
Decoding isn’t the right term for Kafka, but we will dig into those details in later chapters.
Kafka, as does other message brokers, acts, in reductionist terms, as a middle man to data
coming into the system (from producers) and out of the system (consumers). By allowing this
separation between the producer and end-user of the message, loose coupling can be achieved.
The producer can send whatever messages it wants and have no clue about if anyone is
subscribed.
Further, Kafka also has various ways that it can deliver messages to fit your business case. Kafka
message delivery can take at least the following three delivery methods:
At least once semantics
At most once semantics
Exactly once semantics
Let’s dig into what those messaging options mean.
11. Figure 1.3 At Least Once message flow semantics
Kafka’s default guarantee is at least once semantics. This means that Kafka can be configured to
allow for a producer of messages to send the same message more than once and have it written to
the brokers. When a message has not received a guarantee that it was written to the broker, the
producer can send the message again in order to try again. For those cases where you can’t miss
a message, say that someone has paid an invoice, this guarantee might take some filtering on the
consumer end, but is one of the safest methods for delivery.
Figure 1.4 At Most Once message flow semantics
Moving on, at most once semantics are when a producer of messages might send a message once
and never retires. In the event of a failure, the producer moves on and never attempts to send
again. Why would someone ever be okay with losing a message? If a popular website is tracking
page views for visitors, it might be fine with missing a few page few events out of the millions
12. they do process per day. Keeping the system performing and not waiting on acknowledgements
might outweigh any gain from lost data.
Figure 1.5 Exactly Once message flow semantics
Exactly once semantics (EOS) are one of the newest additions to the Kafka feature set and
generated a lot of discussion with its release. In the context of a Kafka system, if a producer
sends a message more than once, it would still be delivered once to the end consumer. EOS has
touch points at all layers of Kafka, from producers, topics, brokers, and consumers and will be
tackled as we move along our discussion later in this book.
Besides various delivery options, another common message broker benefit is if the consuming
application is down due to errors or maintenance, the producer does not need to wait on the
consumer to handle the message. When consumers start to come back and process data, they
should be able to pick up where they left off and not drop messages.
With many traditional companies facing challenges of becoming more and more technical and
software-driven, one of the questions is how will they be prepared for the future. Kafka is noted
for being a workhorse that also throws in replication and fault-tolerance as a default.
Some companies, including Netflix and LinkedIn, have already reached the level of processing
over 1 trillion messages per day with their deployments. Millions of messages per second are
1.2 Why the need for Kafka?
13. possible in production settings; all with a tool that was not at its 1.0 version release (which
finally occurred in October of 2017). Their enormous data processing needs are handled with
their production usage of Kafka. These examples show the potentially of what Kafka can do for
even massive data use cases at scale.
However, besides these headline grabbing facts, why would users want to start looking at Kafka?
Why would a software developer be interested in Kafka?
Kafka usage is exploding and the developer demand isn’t being met. A shift in traditional data
1
process thinking is needed and various shared experiences or past pain points can help
developers see why Kafka could be an appealing step forward in their data architectures.
One of the various on-ramps for newer developers to Kafka is a way to apply things they know
to help them with the unknown. For Java developers used to Spring concepts and dependency
injection (DI) Spring Kafka ( ) has already been through a couple
projects.spring.io/spring-kafka
of major release versions. Supporting projects as well as Kafka itself has a growing tool
ecosystem of its own.
As a pretty common shared milestone, most programmers have experienced the pain of coupling.
For example, you want to make a change but you might have many other applications directly
tied to it. Or you start to unit test and see the large amount of mocks you are having to create.
Kafka, when applied thoughtfully, can help in this situation.
Figure 1.6 Before Kafka message flow
1.2.1 Why Kafka for the Developer
14. Take for example an HR system that employees would use to submit paid vacation. If you are
used to a create, read, update, and delete (CRUD) system, the submission of time off would
likely be processed by not only payroll but also project burn down charts for forecasting work.
So do you tie the two applications together? What if the payroll system was down? Should that
really impact the availability of the forecasting tooling? With Kafka, we will see the benefits of
being able to decouple some of the applications that we have tied together in older designs.
Figure 1.7 After Kafka message flow
With the above view of putting Kafka in the middle of the flow, your interface to data becomes
Kafka instead of various APIs and databases.
Some will say that there are pretty simple solutions. What about using ETL to at least load the
data into its own databases for each application? That would only be one interface per
application and easy, right? But what if the initial source of data was corrupted or updated? How
often do you look for updates and allow for lag or consistency? And do those copies ever get out
of date or diverge so far from the source that it would be hard to run that flow over and get the
same results? What is the source of truth? Kafka can help avoid these issues.
Another interesting topic that might add credibility to the use of Kafka is how much it dog-foods
itself. When we dig into Consumers in Chapter 5, we will see how Kafka uses topics under the
hood to manage commit offsets. And in release 0.11, exactly once semantics for Kafka also uses
internal topics that are leveraged by the Transaction Coordination. The ability to have many
consumers of the data use the same message is better than a choose your own adventure game, as
all outcomes are possible.
Another developer question might be: Why not learn Kafka Streams, Spark Streaming, or other
platforms and skip learning about core Kafka? For one, the number of applications that use
Kafka under the covers is indeed impressive. While abstraction layers are often nice to have (and
15. sometimes close to required with so many moving parts), I really believe that Kafka itself is
worth learning. There is a difference in knowing that Kafka is a channel option for Flume and
understanding what all of the config options mean. And while Kafka Streams can simplify
examples you might see in this book, it is interesting to note how successful Kafka was before
Streams were even introduced. The base is fundamental and will hopefully help you see why
Kafka is used in some applications and what is happening under the hood.
From a purely technical viewpoint, there are interesting computer science topics applied in
practical ways. Perhaps the most talked about is the notion of a distributed commit log which we
will discuss in-depth in Chapter 2. And a personal favorite, Hierarchical Timing Wheels (
. Taking a peek into the
apache-kafka-purgatory-hierarchical-timing-whe els
core.src.main.scala.kafka.utils.timer.Timer.scala class and you can see how Kafka handles a
problem of scale by applying an interesting data structure to solve a practical problem.
I would also note that the fact that it’s open source is a positive for being able to dig into the
source code and also have documentation and examples just by searching the internet. This alone
can be worth avoiding the Not Invented Here syndrome.
As often the case, sometimes members of the C-suite can hear the term 'Kafka' and might be
more confused by the name than care about what it really does. As conferences have taken to
making the case for attendees to help convince their boss about attending conferences, it might
be nice to do the same for explaining the value found in this product as well. Also, it really is
good to take a step back and look at the larger picture of what the real value add is for this tool.
One of the most important features of Kafka is the ability to take volumes of data and make it
available for use by various business units. Nothing is prescribed, but it is a potential outcome.
Most executives will also know that more data than ever is flooding in and they want insights as
fast as possible. Rather than pay for data to molder on disk, value can be derived from most of it
as it arrives. Kafka is one way to move away from a daily batch job that limited how quickly that
data could be turned into value. Fast Data seems to be a newer term that hints that there is real
value focus on something different from the promises of Big Data alone.
Running on the JVM should be a familiar and comfortable place for many enterprise
development shops. The ability to run on-premise is a key driver for some whose data requires
on-site oversight. And the Cloud is also an option as well. It can grow horizontally and not
depend on vertical scaling that might eventually reach an expensive peak.
And maybe one of the most important reasons to learn about Kafka is to see how startup and
other disrupters in their industry are able to overcome the once prohibitive cost of computing
1.2.2 Explaining Kafka to your manager
16. power. Instead of relying on a bigger and beefier server or a mainframe that can cost millions of
dollars, distributed applications and architectures put competitors quickly within reach with
hopefully less financial outlay.
When you are first starting to learn any new technology, it is often natural for the learner to try to
map their existing knowledge to new concepts. While that technique can be used in learning
Kafka, I wanted to note some of the most common misconceptions that I have run into in my
work so far.
As mentioned, Kafka is a powerful tool that is often used in various situations. However, it
seemed to appear on radars when used in the Hadoop ecosystem and might have first appeared as
a bonus tool as part of a Cloudera or Hortonworks suite. It isn’t uncommon to hear the myth that
Kafka only works on Hadoop. What could cause this confusion? One of the causes is likely the
various tools that use Kafka as part of their own products. Spark Streaming and Flume are
examples of tools that use Kafka. The dependency on ZooKeeper is also a tool that is often found
in Hadoop clusters and might tie Kafka further to this myth.
One other key myth that often appears is that Kafka requires the Hadoop Filesystem - HDFS.
Once we start to dig into how Kafka works, we see the speed of Kafka is achieved with
techniques that would likely be slowed down with a Node Manager in the middle of the process.
Also, the replications that are usually a part of HDFS would be even more replications if your
topics ever used more than one replica. The ideas of replication also lead to another logical group
of confusion, the durability that is marketed for Kafka topics might be easy to group under the
Hadoop theme of expecting failure as a default (and thus planning for overcoming it).
Another big myth is that Kafka is just another message broker. Direct comparisons of the
features of various tools such as RabbitMQ or MQSeries to Kafka often have asterisks (or fine
print) attached. Some tools over time have gained or will gain new features just as Kafka has
added Exactly Once Semantics. And default configurations can be changed to mirror features
closer to other tools in the same space.
In general, some of the most interesting and different features are the following that we will dig
into below:
The ability to replay messages by default
Parallel processing of data
Kafka was designed to have multiple consumers. What that means is one application reading a
1.3 Kafka Myths
1.3.1 Kafka only works with Hadoop
1.3.2 Kafka is the same as other message brokers
17. message off of the message brokers doesn’t remove it from other applications that might want to
consume it as well. One effect of this is that a consumer that has already seen that message can
choose to read that (and other messages) again. With some architecture models such as Lambda,
programmer mistakes are expected just as much as hardware failure. Imagine consuming
millions of messages you forgot to use a specific field from the original message. In some
queues, that message would have been removed or have been sent to a duplicate or replay
location. However, Kafka provides a way for Consumers to seek to specific points and can read
messages (with a few constraints) again by just seeking to an earlier position on the topic.
As touched on briefly above, Kafka allows for parallel processing of data and can have multiple
consumers on the same exact topic. With the concept of consumers being part of a Consumer
Group, membership in a group determines which consumers get which messages and what work
has been done in that group of consumers. Consumer groups act independently of the other
groups and allow for multiple applications to consume messages at their own pace with as many
consumers as they require. So the processing can happen in a couple of ways: Consumption by
many consumers working on one application and consumption by many applications.
No matter what other message brokers support, let’s now focus on the powerful use cases that
have made Kafka one of the default options developers turn to for getting work done.
I am large, I contain multitudes.
– Walt Whitman
Applying Kafka to practical use is the core aim of this book. One of the things to note with
Kafka is that it’s hard to say it does one specific function well; it really has many specific uses in
which it can excel. While we have some basic ideas to grasp first, it might be helpful to discuss
at a high-level some of the cases that Kafka has already been noted for use in real world use
cases.
Many users' first experience with Kafka (as was mine) was using it as a messaging tool.
Personally, after years of using other tools like IBM WebSphere MQ (formerly MQ Series),
Kafka (which was around version 0.8.3 at the time) seemed simple to use to get messages from
point A to point B. It forgoes using the Extensible Messaging and Presence Protocol (XMPP),
the Advanced Message Queuing Protocol (AMQP), or Java Message Service (JMS) API in favor
of a custom TCP binary protocol.
We will dig in and see some complex uses later, but as an end-user developing with a Kafka
client, most of the details are in the configuration and the logic becomes rather straightforward;
ie. I want to place a message on this topic.
1.4 Real World Use Cases
1.4.1 Messaging
18. Having a durable channel for sending messages is also why Kafka is used. Often times, memory
storage of data will not be enough to protect your data; if that server dies, the messages are not
persisted across a reboot. High availability and persistent storage are built into Kafka from the
start. In fact, Apache Flume provides a Kafka Channel option since the replication and
availability allow Flume events to be made immediately available to other sinks if a Flume agent
(or the server it is running on) crashes. Kafka enables robust applications to be built and helps
handle the expected failures that distributed applications are bound to run into at some point.
Part of Kafka’s origin story is serving as a way to gather information about users on Linkedin’s
website. Kafka’s ability to handle large volumes of data was a key requirement since a website
with many visitors had the need to handle the possibility of multiple events per page view. The
flood of data had to be dealt with fast and able to scale without impacting the end-user’s
experience on the site. Did a user click on a link or visit the new marketing page? Those frequent
user events can be fed into Kafka and made quickly available to various applications to get an
overall view of the paths consumers take through a shopping site (for instance). Imagine the
ability to do a real-time feed of data to show customers recommended products on the next page
click as one example of the importance of speed in a e-commerce flow.
Figure 1.8 Kafka Log Aggregation
Log aggregation is useful in many situations, including when trying to gather application events
that were written in distributed applications. In the figure above, the log files are being sent as
messages into Kafka and then different applications have a logical single topic to consume that
1.4.2 Website Activity Tracking
1.4.3 Log Aggregation
19. information. With Kafka’s ability to handle large amounts of data, collecting events from various
servers or sources is a key feature. Depending on the contents of the log event itself, some
organizations have been able to use it for auditing as well as failure detection trending. Kafka is
also used in various logging tools (or as an input option) such as Graylog ( ).
www.graylog.org
How do all of these log files entries even allow Kafka to maintain performance without causing a
server to run out of resources? The throughput of small messages can sometimes overwhelm a
system since the processing of each method takes time and overhead. Kafka uses batching of
messages for sending data as well as writing data. Writing to the end of a log helps as well rather
than random access to the filesystem. We will discuss batching in Chapter 4 and more on the log
format of messages in Chapter 6 and 7.
Kafka has placed itself as a fundamental piece for allowing developers to get data quickly. While
Kafka Streams is now a likely default for many when starting work, Kafka had already
established itself as a successful solution by the time the Streams API was released in 2016. The
Streams API can be thought of as a layer that sits on top of producers and consumers. This
abstraction layer is a client library that is providing a higher level view of working with your
data as an unbounded stream.
In the Kafka 0.11 release, exactly once semantics were introduced. We will cover what that
really means in practice later on once we get a more solid foundation. However, for users who
are running end-to-end workloads inside Kafka with the Streams API, message delivery now is
more of what most users would find as ideal. Imagine banks using Kafka to debit or credit your
account. With at least once semantics, you would have to ensure that a debit was not completed
twice (due to duplication of messages) through various consumer side logic. Streams makes this
use case easier than it has ever been before to complete a flow without any custom application
logic overhead of ensuring a message was was only processed once from the beginning to the
end of the transaction.
1.4.4 Stream Processing
20. Figure 1.9 IoT
The number of internet-connected devices seems like the Internet of Things will have no where
to go but up. With all of those devices sending messages, sometimes in bursts whenever they get
a wifi or cellular connection, something needs to be able to handle that data effectively. As you
may have gathered, massive quantities of data is one of the key areas where Kafka really shines.
As we discussed above, small messages are not a problem for Kafka. Beacons, cars, phones,
homes, all will be sending data and something needs to handle the firehose of data and make it
available for action.
These are just a small selection of examples that are well-known uses for Kafka. As we will see
in future chapters, Kafka has many practical application domains. Learning the upcoming
foundational concepts is important to be able to see how even more practical applications are
possible.
It is important to note that while Kafka has shown some really interesting use cases, it is not
always the best tool for the job at hand. Let’s take a quick look at some of the uses where other
tools or code might shine.
What if you only need a once monthly or even once yearly summary of aggregate data? If you
don’t need an on-demand view, quick answer, or even the ability to reprocess data, then you
might not need Kafka running throughout the entire year for that task alone. Especially, if that
1.4.5 Internet of Things
1.4.6 When Kafka might not be the right fit
21. amount of data is manageble to process at once as a batch (as always, your mileage may vary:
different users have different thresholds on what is large batch).
If your main access pattern for data is mostly random lookup of data, Kafka might not be your
best option. Linear read and writes is where Kafka shines and will keep your data moving as
quickly as possible. Even if you have heard of Kafka having index files, they are not really what
you would compare to a relational database having fields and primary keys that indexes are built
off of.
Similarly, if you need exact ordering of messages in Kafka for the entire topic, you will have to
look at how practical your workload is in that situation. To avoid any unordered messages, care
would have to be taken to make sure that only 1 producer request thread is the max at one time
and that there is only 1 partition in the topic. There are various workarounds, but if you have
huge amounts of data that depends on strict ordering, there are potential gotchas that might come
into play once you notice that your consumption would be limited to one consumer per group at
a time.
One of the other practical items that come into mind is that large messages are an interesting
challenge. The default message size is about 1 MB. With larger messages, you start to see
memory pressure increase. In other words, the less page messages you can store in page cache is
one main concern. So if you are planning on sending huge archives around, you might want to
look at if there is a better way to manage those messages.
Keep in mind, while you could probably achieve your end goal with Kafka in the above
situations (it’s always possible), it might not be the first choice to reach for in the toolbox.
The community around Kafka has been one of the best (in my opinion) in making documentation
available. Kafka has been a part of Apache (graduating from the Incubator in 2012), and keeps
current documentation at the project website at .
kafka.apache.org
Another great resource for more information is Confluent ( ).
www.confluent.io/resource s
Confluent was founded by some of the creators of Kafka and is actively influencing future
direction of the work. They also build enterprise specific features and support for companies to
help develop their streaming platform. Their work helps support the open source nature of the
tool and has extended to presentations and lectures that have discussed production challenges and
successes.
As we start to dig into more APIs and configuration options in later chapters, these resources will
be a good reference if further details are needed rather than list them all in these chapters.
1.5 Online resources to get started
22. This chapter was about getting familiar with Kafka and its use cases at a very high level. In the
next chapter, we will look at more details in which we use specific terms and start to get to know
Apache Kafka in a more tangible and hands-on way.
In this chapter we:
Discussed the streaming and fault-tolerance of Kafka that makes it a modern distributed
solution
Discovered that Kafka is not exclusive to Hadoop or HDFS. While it uses some of the
same fault-tolerance and distributed systems techniques, it can stand alone as its own
cluster.
Talked about special features that make Kafka standout from other message brokers. This
includes its replayable messages and multiple consumers features.
Displayed specific use cases where Kafka has been used in production. These uses
include messaging, website activity tracking, log aggregation, stream processing, and IoT
data processing.
1.6 Summary
23. 2
This chapters covers:
Now that we have a very high-level view of why we would try out Kafka, this is the point at
which we want to start and get more concrete with our terms and understanding, and look at the
components that make up the whole of this system.
This chapter will also involve us setting up Kafka for the rest of our examples. While a
distributed system, Kafka can be installed and run on a single machine. This will give us a
starting point to dive into our hands-on use. As is often the case, the real questions start to appear
once the hands hit the keyboard.
By the end of this chapter, you will also be able to send and retrieve your first Kafka message
from the command line. If you do not have Kafka set up already, please refer to Appendix B to
help you get started so you can get Kafka running on your computer. Let’s get started with Kafka
and then spend a little more time digging into the details of Kafka’s architecture.
Getting to know Kafka
Sending and receiving your first Kafka message from the command line.
Reviewing the high-level architecture of Kafka.
Understanding client options and how your applications can communicate to the
system.
Creating messages with the Java client.
24. Let’s start using Kafka! Hopefully by now you have updated the configuration and started the 3
brokers we will be using in our examples and confirmed that they are still running (check out
Appendix B if you have not set it up yet). With our broker setup ready, one major question now
becomes: What do we really need to send when we talk to Kafka? For our first example, we are
going to be creating a topic and sending our first message to Kafka from the command line.
Messages are how your data is represented in Kafka. You will also see references to messages as
records as those terms are often used interchangeably. Each message consists of a Key and a
Value. A key is not required and we are just going to be sending a value in our first example.
Figure 2.1 shows the general format of messages that users will be dealing with directly.
Figure 2.1 Kafka messages are made up a key and value
One thing that you should note is that Kafka was built with the command line in mind. There
really is not a GUI that we will be using, so that is why it is important for us to have a way to
interact with the operating system’s command line interface. The following commands will be
entered in a text-based prompt. Whether you use vi, emacs, nano, or whatever: just make sure
that it is something you feel comfortable editing with. While Kafka can be used on many
operating systems, it is often deployed in production on Linux and command line skills will help
your usage of this product.
TIP Shell Helper
If you are a command line user and want a shortcut to auto-complete some
of the commands (and help with the arguments available): Check out a
K a f k a a u t o - c o m p l e t e p r o j e c t a t
.
github.com/DylanLWScott/kafka_tools_completion
In order to send our first message, we will need a place to send it to. We will create a topic by
running the kafka-topics.sh command in a shell window with the option. This script is
--create
2.1 Kafka’s Hello World: Sending and retrieving our first
message
25. provided in your install of Kafka and delegates to Scala classes. Please note that any Windows
users can use the bat files with the same name as the shell equivalent. For example,
kafka-topics.sh has the windows equivalent script named .
kafka-topics.bat
Listing 2.1 Creating the helloworld Topic
You should see the ouput: Created topic "helloworld".
In this example, we are going to use the name 'helloworld' for our topic. You can use your own
name of course, consisting of upper and lower case characters, numbers, period, underscore, and
dash (-). My personal preference is to follow general naming conventions that you would follow
when using Unix/Linux. You will probably avoid a lot of frustrating errors and warnings if you
do not have spaces or various special characters that do not always play nice with what you
really want to do.
A couple of the other options are not as clear about their meaning at first glance. The
partitions option is used to tell how many parts you want the topic to be split into. For
example, since we have three brokers, using three partitions will give us a partition per broker.
For our test workloads, we might not need this many. However, doing more than one at this stage
will let us take a peek at how the system works and can spread data across partitions. The
replication-factor also is set to three in this example. In essence, it says that for each
partition, we are attempting to have three replicas of each one and will be a key part of your
design to improve reliability and fault-tolerance. The option is also pointed to our
zookeeper
local instance of zookeeper which should have been running before you started your brokers. For
our work right now, the most important goal is to get a picture of the layout as we dig into the
details of how to make a best estimate at the numbers you will need in your other use cases when
we get into broker details.
At this point, you can also look at any existing topics you have created and make sure that your
new one is in the list. The option is what we can reach for to achieve this output. Again,
--list
we will run this command in the terminal window.
Listing 2.2 Verify the Topic
To get a feel for how our fresh topic looks, let’s run another command that will give us a little
more insight into our cluster. You can see that when we describe the topic, we get more details
from the broker. You really can see that it is not like a traditional single topic in other systems.
The numbers you see under by the leader, replicas, and isr fields are the that we set
broker.id
in our configuration files. Briefly looking at the output, for example, we can see that our broker
bin/kafka-topics.sh --zookeeper localhost:2181
--create --topic helloworld --partitions 3 --replication-factor 3
bin/kafka-topics.sh --zookeeper localhost:2181 --list
26. id of 0 is the leader for partition 0. Partition 0 also has replicas that exist on brokers 1 and 2. The
last column "isr" stands for in-sync replicas. Having a partition copy that is out of date or behind
the leader is an issue that we will cover later but is an important point to remember that replicas
in a distributed system can be something that we will want to keep an eye out for.
Listing 2.3 View topic layout
The option lets us look at the details of the topic we pass in
describe
The shows a quick summary of the total count of partitions and replicas that this
topic has
Each partition in tht topic is shown. This is for partition labeled 0
This shows the leader for the specific partition (0 in this case). Leader 0 means the
message broker with id 0
Replicas tells us that the copies of this partition reside on the message brokers with
those ids
Insync replicas (ISR) shows the message brokers that are caught up with the leader
and are not lagging behind
Figure 2.2 View of one broker
Now that we have our topic created, we can start sending real messages! Those who might have
worked with Kafka before might ask why we took the above step to create the topic before we
sent a message. There is configuration to enable or disable auto-creation of topics. However, I
prefer to control the creation of topics as a specific action and do not want any new topics to
randomly show up if I mistype a topic name once or twice or be recreated due to producer
retires.
To send a message, we are going to start-up a terminal tab or window to run a producer that will
run as a console application and take user-input. The below command will start an interactive
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic helloworld
Topic:helloworld PartitionCount:3 ReplicationFactor:3 Configs:
Topic: helloworld Partition: 0 Leader: 0 Replicas: 0,1,2 Isr: 0,1,2
Topic: helloworld Partition: 1 Leader: 1 Replicas: 1,2,0 Isr: 1,2,0
Topic: helloworld Partition: 2 Leader: 2 Replicas: 2,0,1 Isr: 2,0,1
27. program that will take over that shell (you won’t get your prompt back to type more commands
until you press Ctrl-C to quit the running application). You can just start typing, maybe
something as simple as the default programmer’s first print statement: helloworld.
Listing 2.4 Kafka Producer Command
Now, we are going to start-up a new terminal tab or window to run a consumer that will also run
as a console application. The below command will start a program that will take over that shell
as well. On this end, you will hopefully see the message you had written in the producer console!
Note to make sure that you are using the same parameter for both commands if you do not
topic
see anything.
Figure 2.3 Example Consumer Output
Listing 2.5 Kafka Consumer Command
As you send more messages and confirm the delivery to the consumer application, feel free to
terminate the process and leave off the --from-beginning option when you restart it. Did you
notice that you didn’t see every message you have ever sent before? Only those messages
produced since the consumer console was started show up. The knowledge of which messages to
read next and the ability to consume from a specific offset will be tools we will leverage later as
we discuss consumers in Chapter 5.
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic helloworld
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092
--topic helloworld --from-beginning
28. One thing that some readers might have noticed from the exercises above is that the producer and
consumer console scripts used a parameter called bootstrap-server. Contacting a message
broker provides enough information to get the job done for these commands that send and
retrieve messages. However, if we look at the kafka-topics command, we see that a zookeeper
parameter is needed. The reliance on zookeeper has been lessened with later client versions, but
ZooKeeper still provides value that we will touch on a little later in this chapter.
Now that we have seen a simple example in action, we have a little more context in order to
discuss the parts we utilized above.
Let’s dig into each of these items further to get a solid foundation for our following chapters.
Figure 2.4 Producers vs Consumer
A Producer is the way to send messages to Kafka topics. As mentioned in our use cases in
Chapter 1, a good example is log files that are produced from an application. Those files are not
a part of the Kafka system until they are collected and sent into Kafka. When you think of input
or data going into Kafka, you are looking at a producer being involved somewhere under the
covers. There are no default producers, per se, but APIs that interact with Kafka are using them
in their own implementation code. Some of the entry ways might include using a separate tool
such as Flume or even other Kafka APIs such as Connect and Streams. ,
WorkerSourceTask
inside the Kafka Connect source code, is one example where a producer is used, but inside the
2.2 A quick tour of Kafka
Table 2.1 The major components and their roles within the Kafka architecture
m
Component Role
Producer Sends message to Kafka
Consumer Retrieves messages from Kafka
Topics Logical name of where message are stored in the broker
ZooKeeper ensemble Helps maintain consensus in the cluster
Broker Handles the commit log
29. API that the end-user uses. A producer is also a way to send messages inside Kafka itself. For
example, if you are reading data from a specific topic and wanted to send it to a different topic,
you would also use a producer.
To get a feel for what our own producer will look like in an upcoming example, it might be
helpful to look at code used in WorkerSourceTask that was a Java class mentioned earlier. Not
all of the source code is listed for the method sendRecords(), but what is left is the logic
dealing with sending a message with the standard KafkaProducer. It is not important to
understand each part of the following example, but just try to get familiar with the usage of the
producer.
Listing 2.6 WorkerSourceTask sending messages
The ProducerRecord will be what holds each message being sent into Kafka
producer.send is what starts the actual call to send to our brokers
A callback can be used for asynchronous sending of messages
private boolean sendRecords() {
...
final ProducerRecord<byte[], byte[]> producerRecord = new ProducerRecord<>(record.topic(),
record.kafkaPartition(),
...
try {
final String topic = producerRecord.topic();
producer.send(producerRecord,
new Callback() {
@Override
public void onCompletion(RecordMetadata recordMetadata, Exception e) {
if (e != null) {
log.error("{} failed to send record to {}: {}", this, topic, e);
log.debug("{} Failed record: {}", this, preTransformRecord);
} else {
log.trace("{} Wrote record successfully: topic {} partition {} offset {}",
this,
recordMetadata.topic(), recordMetadata.partition(),
recordMetadata.offset());
commitTaskRecord(preTransformRecord);
}
recordSent(producerRecord);
counter.completeRecord();
}
});
lastSendFailed = false;
} catch (RetriableException e) {
log.warn("{} Failed to send {}, backing off before retrying:", this, producerRecord, e);
toSend = toSend.subList(processed, toSend.size());
lastSendFailed = true;
counter.retryRemaining();
return false;
} catch (KafkaException e) {
throw new ConnectException("Unrecoverable exception trying to send", e);
}
processed++;
}
toSend = null;
return true;
}
30. These are not thrown by the producer API but are good to know that Kafka often
deals with errors and attempts to retry if possible
Figure 2.5 Producer Example
Figure 2.5 shows a user interaction that could start the process of data into a producer flow.
In contrast, a Consumer is the way to retrieve messages from Kafka. In the same vein as
producers, if you are talking about getting data out of Kafka, you are looking at consumers being
involved directly or somewhere in the process. WorkerSinkTask is one similarly named class
inside Kafka Connect that shows the same usage of a consumer in Connect as a parallel with the
similar producer example above. Consuming applications will subscribe to the topics that they
are interested in and continuously poll for data. WorkerSinkTask is a real example in which a
consumer is used to retrieve records from topics in Kafka.
Listing 2.7 WorkerSinkTask consuming messages
The consumer needs to subscribe to the topics that it cares about
Messages are returned from a poll of data
protected void initializeAndStart() {
String topicsStr = taskConfig.get(SinkTask.TOPICS_CONFIG);
if (topicsStr == null || topicsStr.isEmpty())
throw new ConnectException("Sink tasks require a list of topics.");
String[] topics = topicsStr.split(",");
consumer.subscribe(Arrays.asList(topics), new HandleRebalance());
...
}
protected void poll(long timeoutMs) {
...
ConsumerRecords<byte[], byte[]> msgs = pollConsumer(timeoutMs);
assert messageBatch.isEmpty() || msgs.isEmpty();
log.trace("{} Polling returned {} messages", this, msgs.count());
convertMessages(msgs);
deliverMessages();
}
31. Figure 2.6 Consumer Example
These examples above can show two parts of a concrete example as shown in Figures 2.5 and
2.6. Let’s say that an ad agency wants to know how many users clicked on an ad for a new
product. The clicks and events generated by users would be the data going into the Kafka
ecosystem. The consumers of the data would be the ad agency’s itself that would be able to use
its own applications to make sense of that data. Putting data into Kafka and out of Kafka with
code like the above (or even with Connect itself) allows users to be able to work with the data
that can impact their business requirements and goals.
32. Figure 2.7 Segment files make up partitions. Partitions make up Topics.
Topics are where most users will start to think about the logic of what messages should go
where. Topics are actually made out of units called partitions. In other words, one or many
partitions can make up a single topic. As far as what is actually implemented on the computer’s
disk, partitions are what Kafka will be working with for the most part. A single partition only
exists on one broker and will not be split between brokers. Figure 2.7 shows how each partition
will exist on a single message broker and will not be divided smaller than that unit. Think back
to our first example of the helloworld topic. If you are looking at reliability and want 3 copies of
the data, the topic itself is not one entity (or single file) that is copied; rather it is the various
partitions that are replicated 3 times each. As a side note, the partition is even further broken up
into segment files (the actual) files written on the disk drive. We will cover the details of these
files and their location when we talk about brokers in later chapters.
One of the most important concepts to understand at this point is the idea that one of the partition
copies (replicas) will be what is referred to as a 'leader'. For example, if you have a topic made
up of 3 partitions and a replication factor of 3, each and every partitions will have a leader
elected. That leader will be one of the copies of the partition and the others 2 (in this case) will
be followers that update their information from their partition leader. Producers and consumers
will only read or write (in happy path scenarios) from the leader of each partition it is assigned.
But how does your producer or consumer know which partition is the leader? In the event of
distributed computing and random failures, that answer is often influenced with help from
ZooKeeper.
34. The parodies, rich in thieves' slang, at an end, and the bottles
empty, the grateful pensioners of the national workshops resumed
their march, cutting practical jokes, and cudgel-playing with the
acacias, which were considerably deteriorated by the proceeding.
"Such," says Jérome Paturot, "was the end of this memorable day,
during which Oscar and myself were enabled to appreciate a
national workshop and the services it rendered. The account was
easily made up. Two hundred and fifty men had carried two hundred
and fifty saplings. Two francs for each man's day's work, and three
francs for each acacia, made five hundred francs on the one hand,
and seven hundred and fifty on the other. Total cost, twelve hundred
and fifty francs. Not one of the plants survived the consequences of
the breakfast, notwithstanding which there was the expense of
planting them, and afterwards that of digging them up. Double
work, double charges. Such were the national workshops; such the
profits of the institution."
The allusion in the tavern-scene to Mademoiselle Rachel is not the
only cut administered by M. Reybaud to the tragedy-queen of the
French republican stage.
Jérome and Oscar, strolling one evening down the Rue Richelieu,
found a crowd at the theatre doors. The Provisional Government
treated the people to the play. The whole mass of tickets was
divided amongst the twelve mayors of Paris, who distributed them in
their arrondissements. But somehow or other a considerable number
had got into the hands of the ticket merchants, and for twenty
francs Paturot and his companion obtained a couple of stalls. The
play over, the hour of the Marseillaise arrived.
"The tragedian approached the foot-lamps, a tricoloured flag in her
hand. Her manner of singing the republican hymn at once carried
away and revolted the hearer. It was like the roar of the lioness
urging her male to the combat. The tone was not of our period; its
energy and ferocity had no sufficient motive. It breathed vengeance
—where was the injury to revenge? conquest—and where the
territory to conquer? Even as an artistical study, the effect should
35. have been more measured, more restrained. That effect was
nevertheless great, and was felt by every one in the theatre. Under
the flash of that glance and the power of that voice, a sort of low
shuddering ran along the benches, and was broken only by a
universal acclamation. The enthusiasm sustained itself thus to the
last couplet, which was of itself a scene and a tableau."
The song over, a workman in a blouse leaped upon the stage, bent
his knee before the actress, and presented her with a bouquet of
choice flowers and a paper. The manager, at the demand of the
audience, read the latter aloud. It was the following acrostic in
honour of Rachel:—
R eine de l'empire magique,
A vous ce don de l'ouvrier;
C harmez-nous par votre art magique,
H éroïne au royal cimier,
E t chantez d'un accent guerrier
L' hymne ardent de la république.
This apropos piece of gallantry drew down thunders of applause, to
which the members of the Provisional Government there present
contributed their share. But Paturot had recognised, to his great
surprise, in the bouquet-bearer, the smart young scamp of whom he
had purchased his admission, and whom he had noticed as being
evidently a leading character amongst the not very reputable
fraternity of ticket-mongers. Curious to penetrate the secret of his
sudden metamorphosis, he followed him, and overheard his
conversation with his colleagues. The bouquet had cost fifty francs,
the acrostic five, flowers of literature being cheaper under the
republic than those of the hothouse. Mitouflet's comrades are
bewildered by his extravagance, until he divulges the secret that—
government pays. "Happy nation!" exclaims Jérome, "whom a
benevolent government finds in bread and tragedies! What more can
it desire?"
36. No class of society escapes M. Reybaud's satire. Under the title of
"The Victims of Events," he devotes a chapter to the authors, artists,
and actors whom the revolution has deprived of bread. They deserve
their fate, he maintains; they have abandoned the true for the
worship of false gods, they have dealt in maleficent philters instead
of wholesome medicines; they have used their power to mislead and
corrupt, not to guide and rightly direct, those who pinned their faith
on their performances. They were mischievous quacks, not
conscientious physicians. The literary sufferers are the first whom he
exhibits. "Some employed history as a die, and struck with it a coin
of very base metal." Take that, M. Dumas. "Others fomented violent
instincts in the bosom of the masses, and invited them to
sacrilegious revolts, exhibiting only the impurities of civilisation, and
conducting the people to anger by the road of disgust." This, we
need hardly say, is levelled at the Sue school. But the names of
these men, one day so loud in the ears of the multitude, the next
were drowned in the tumult of revolutions. "To fill the cup of
bitterness to the brim, it was not honour alone that remained on this
calamitous field of battle. The bank-notes shared the same fate.
Who would have predicted this, in those opulent days, when a piece
of gold was found at the end of every line, like the natural product
of a seemingly inexhaustible mine? Who would have foretold it in
those hours of success, amidst the intoxications of luxury, and in the
indulgence of a thousand caprices worthy an Eastern prince? Every
road was then strewed with emeralds, every path covered with
rubies. There was no style of living that Imagination, with its fairy
fingers, could not sustain. She gave her favourites every thing—
coaches and lackeys, open house, and a prince's retinue. How
remote is that happy time! What a falling off in that Asiatic
existence! Where are the emeralds? where the rubies? The bank-
note is a figment; gold a chimera. Money and glory have gone down
into the same tomb.... But the man of style was not easy to
vanquish. He braved neglect, and, deeming himself a necessary
element in the world's economy, he set to work again—only,
following the example of the modern divinities, he took care to
transform himself. Hitherto, politics had appeared to him of
37. secondary importance, and he had abandoned them to colourists of
an inferior grade. Events had rendered them worthy of the great
pens of the age. 'Aha!' said the man of style—'Aha! they force us to
it: very well, they shall see. We lived quietly in the sanctuary of art,
asking but sequins and perfumes of the external world. Provided the
sherbet was cool and the amber bright, what cared we for the rest?
But now they besiege us in our favourite asylum. Distress is at the
door, pressing and menacing. To arms, then, to institute a new
system of politics.' And the man of style entered the arena of
politics, ferula in hand, and spur on heel." But only to encounter a
lamentable break-down. It is pretty evident whom M. Reybaud had
in view when making this sketch, here greatly abridged, but which is
very exact and amusing in its details, and must be particularly
gratifying to Alexander Dumas. He then takes up the painters, and
exposes the system of mutual puffing and hired criticism. The
comedian has his turn: "But lately he reigned and laid down the law.
Each note of his voice was a priceless treasure; his gestures were
current coin. For him the bank had not enough notes, nor fame
enough trumpets. The mob crowded round him, when he walked
abroad, as round a prince of the blood. Vienna and Petersburg
disputed him; the two worlds were his domain. How believe that
such an idol should one day be hurled from his pedestal?
Nevertheless it came to pass. He beheld vacant benches and an
empty treasury. He had been improvident, and misery sat down by
his hearth. Perhaps he then remembered how he had defied fate,
and squandered wealth; how he had abused every thing—his health
and his talent, the public and himself. Had he not given into that
vein of falsehood and monstrosity, which made the theatre a school
of perversity, and art an instrument of disorder? Had he not
degraded the stage by creakings of snuff-boxes and misplaced
hiccups? Had he not ridiculed, in a celebrated type, instincts the
most sacred and worthy of respect? Such excesses escape not
punishment." There is much truth in this. But is it a fact, that
Frederick Lemaitre (here evidently selected as the type of his
profession) has thus suddenly lost his popularity and sunk into
poverty? The last time we saw his name in a French theatrical
38. feuilleton, his successful appearance in a new piece was recorded.
Has he not also, since the revolution, drawn crowds to witness his
performance of Robert Macaire, the piece to which M. Reybaud more
particularly alludes, and which was prohibited under the monarchy,
because Lemaitre, in acting the part of the swindler Robert, used to
make himself up to resemble Louis Philippe, and introduced
unpleasant hits at the King of the French? There is no question,
however, that Lemaitre is an instance of the prostitution of great
talents. With more respect for himself and for the public, he might
have aspired to a high place in the profession, with one of whose
lower walks he has all his life remained contented.
Meanwhile, secret hands were at work preparing a movement, of
which the national workshop was to be the chief instrument. One
morning, when stone-breaking at the Porte Maillot, Percheron took
Comtois aside to inform him that the clubs had decided on an
outbreak. Comtois does not at first relish the idea, and is anxious to
return to his hammer and pebbles, but Percheron, who, by reason of
his superior intelligence, is one of six workmen to whom the plan
has been communicated, bewilders the simple giant by the sunny
prospects he exposes. This time it is the people who will reap the
profits of the revolution. No more kid gloves and varnished boots;
the blouse will be the passport to the good things of this life. No
more wages. All Frenchmen are to be partners. An immense
association; real equality; the workman well dressed, well fed, well
housed, and always with twenty-five francs in his pocket, guaranteed
by the state. The bourgeois, the rich man, is to be entirely
abolished. Under pain of death, no one is to have more than a
hundred francs in his possession. Costly furniture, plate, carriages,
liveries, fine houses, jewellery, statues, pictures—all are to be
suppressed. Poor stupid Comtois, venturing to inquire what will
become of servants, jewellers, coach-makers, &c., &c., is forthwith
snubbed by his smarter comrade. "They will do something else;
there is to be work for every body." The communists have found an
apt scholar in Percheron. Comtois reflects, admits they can always
break stones, and agrees to place himself, upon the following
39. Monday, at the orders of the conspirators. Upon that day (the
famous 15th May) the fate of the Poles is to be discussed in the
National Assembly; and, under colour of a demonstration in their
favour, a clean sweep is to be made of the representatives of the
people.
There had been so much talk about this debate, that Madame
Paturot resolved to witness it, and by great exertions she obtained a
ticket. She could no longer reckon on Simon for admission, the
ungrateful miller having passed over to the enemy, and yielded
himself captive to the fleshpots and flatteries of the "Provisional."
Jérome, who had a presentiment of danger, urged her not to go, the
more so as she would have to go alone, for he could get no order.
But the exgrisette, all courage and confidence, laughed at the notion
of danger, despised caution, and betook herself to the Chamber.
Paturot and Oscar sauntered on the Boulevards. Nothing indicated a
disturbance, until they reached the Porte St Denis. There the scene
changed as suddenly as at shifter's whistle. A multitude of heads
covered the Boulevard, green branches forming above them an
undulating canopy of verdure. The throng moved steadily in one
direction: songs and cries broke from its bosom. The name of Poland
was predominant. Oscar caught the infection and repeated the cry,
"Vive la Pologne!" In vain Paturot remonstrated. The artist's beard
bristled with excitement. He had passed seven years of his childhood
in the same room with a portrait of Poniatowski taking his famous
leap into the Elster. After that, would Jérome have him forget
Poland? Forbid it, heaven! And "Vive la Pologne!" "The column
advanced, with its leafy trophies—the clubs, the national workshops,
(Comtois and Percheron in the van,) with flags and banners, cards in
their hatbands, and other rallying signs. There was a certain degree
of order. Here and there, at street corners, were seen the great
leaders of the manifestation, presidents of clubs, or persons to
whom captivity had given celebrity, encouraging their men by word
and gesture, now by a short speech, or apropos cheer, then by a
shake of the hand. Oscar knew all these heroes of revolt, these
princes of the prison." And knowing them, the impetuous artist was
40. at least convinced that Poland was only the pretext. He ceased his
ill-advised hurras, and resumed the part of a mere observer. As the
column advanced, the shops shut. The air was full of menacing
sounds. Thousands of Poles and Italians, bearing the banners of
their respective countries, joined the mob. Uniforms abounded,
officers' epaulets were not rare: even those corps charged with the
police of the city contributed their quota to the concourse. The
multitude pressed forward with the confidence of people who
dispose of an empire. The chiefs of the insurrection were not men to
enter the field unadvisedly, and their countenances betrayed a
consciousness of strength. Their passage afforded evidence of a vast
complicity. They advanced, without obstacle or impediment, even to
the very doors of the Assembly. A few bayonets upon the bridge
leading to the palace were overthrown in an instant, and the
building was forthwith surrounded by furious groups. The gates were
burst by Comtois and his companions: the Assembly was invaded. "A
shameful page in our history!" exclaims M. Reybaud. "A sad and
fatal commencement! Time itself cannot efface the stain. Upon the
roll of history will remain recorded the fact, worthy of a barbarian
horde, that, during three hours, an Assembly, chosen by the voices
of the whole nation, was left exposed, defenceless, to the outrages
of turbulent scholars, and to the contact of impure adventurers."
Uneasy about his wife, Jérome Paturot tried to enter the house, but
one of the insurgents replaced the usual guardian of the gate, and
demanded the card of his club. No admission without proof of his
belonging to the Droits de l'Homme, or the Conservatory, or the
Palais National. So Jerome waited outside. Suddenly a cry was
raised, "To the Hotel de Ville!" and there was an instant rush in that
direction. Oscar, who hitherto had watched for Malvina at one
entrance of the Chamber, whilst his friend stood sentry at the other,
could resist no longer. He had a relapse of the revolutionary vertigo.
"To the Hotel de Ville!" shouted the mob.
"Hurra for the Hotel de Ville!" repeated Oscar. "It is not exactly the
way to the land of the Jagellons; but what matter? What a curious
41. people! Nothing will serve them but to take the Hotel de Ville every
week."
And away went Oscar to share in the capture. The rescue had come,
and the mob was expelled from the Chamber. Jérome, who could
see nothing of Malvina, returned to his lodgings in great alarm. After
a while a porter brings him a letter. It is from Madame Paturot,
giving, in the well-known grisette-dialect, an account of her
adventures, written down in the interval between the expulsion of
the rioters and the resumption of the sitting. It is about ten times as
long as could be written in the time, but it is necessary to narrate
what passed within the Chamber, as well as what occurred without;
and no one is more capable than Malvina. In her picturesque and
popular style, she gives a graphic bulletin of the strange events she
has witnessed. The recital acquires additional interest, when we
remember that M. Reybaud is a member of the Assembly, and was
doubtless present at the scene described. After a certain amount of
satirical gossip touching the appearance of the Assembly, dress of
the members, and the like, Malvina proceeds to the event of the
day: "A black-coated orator occupied the tribune, recalling the
memories of the Empire, and dwelling warmly on the exploits of the
Polish lancers, when a formidable noise made itself heard. It seemed
to come sometimes from without, sometimes from beneath the
ground. I began to think coiners had established themselves in the
palace vaults, or that the Allies had re-entered Paris to blow up the
bridge of Jena. The noise had nothing sustained or regular,—it was
in great bursts, followed by sudden silence. It is best to tell things as
they are, my dear; no use flattering people. The first impression the
Assembly experienced was disagreeable enough: there were some of
the elect of the people, who may not have admitted it to
themselves, but who would have liked to be elsewhere. A mere
matter of preference! A deputy is a man, after all, and the roar at
the door of the palace had nothing very soothing. However, the first
emotion did not last; the sentiment of duty overcame it. They sat
down and waited the event. I don't deny they listened less to Poland
42. than to what passed outside, but their bearing was becoming, and
their countenance good. You may believe me, for I am a judge."
Presently crash went the door, and there entered a legion of ruffians
in blouses. The spectators' galleries and the body of the house were
alike invaded. All the doors gave way, and the Chamber was
thronged. The atmosphere was infected by the obscene multitude,
reeking with wine and tobacco. Filthy flags were waved over the
heads of the deputies. The vilest language was heard; the utmost
confusion prevailed; not one of the intruders seemed to know why
he was there, or what he came to do. The president was under a
kind of arrest, guarded on one side by an artillery-man with drawn
sabre, on the other by a ruffian dressed as a workman; and every
moment the banners of the clubs were waved over his head.
Sometimes he was almost pushed out of his arm-chair by the
popular orators, who got astride upon its back, or stood upon his
table. "The representatives," Madame Paturot speaks, "kept their
seats, and did the Roman senator very tolerably. The rioters did not
meddle much with them, except with two or three, who had scuffles
with the insurgent leaders. Simon was one of those. His seat was
under the gallery, and an insurgent, risking a perilous leap from the
elevation, alighted upon his shoulders. Our miller was not
accustomed to such treatment. A sack of flour—well and good; but a
man was too much. He took this one by the collar, and shook him
nearly to death. The fellow bellowed for assistance, but Simon's
strength deterred interference, and the affair went no further. Others
of the elect of the people were less fortunate, and received at the
hands of their constituents a new baptism, not prescribed by the
constitution. What then, Jerome? Who loves well chastises well.
Thus did these sovereigns of the street testify their affection." The
orator's tribune was besieged by the chiefs of the insurrection—all
anxious to speak. It was continually assaulted and taken; one
speaker pulled down, and another taking his place, to be, in his turn,
expelled. Those who succeeded in making themselves heard,
proposed absurdities. One clamoured for Poland; another would levy
an impost of a thousand millions, to be paid by the rich; a third
43. declared a traitor to his country whosoever should cause the drums
to beat alarm; a fourth notified to the Assembly that it was then and
there dissolved. This last announcement raised a hurricane. "The
mob no longer shouted—it roared. The president still protesting, his
arm-chair was carried by assault. In an instant every thing was
swept away. The bureau of the Assembly was filled with workmen,
who assumed heroic postures, stamped upon and broke every thing.
The representatives could do nothing in this scene of devastation.
One by one they retired. The clubs remained masters of the field of
battle, and the Red banner floated in the hall. The scene attained
the utmost height of confusion. The clubs had the power, or thought
they had, but knew not what to do with it. Lists were made out, and
again destroyed. Names were proclaimed, and forthwith hissed. It
was the Tower of Babel. Who can say how it would have ended but
for the interference of the mobile? Brave mobile! At the very
moment they were least expected, their drums resounded close at
hand." The sound was enough for the rioters, who ran in every
direction, and in ten minutes the hall was clear. Malvina subjoins her
indignant reflections on these extraordinary scenes, casts a
considerable deal of dirt upon the beards of the Provisional
Government, and is curious to know what sort of fricassee
Buonaparte would have made of such a set of braggarts and
incapables.
Madame Paturot had borne herself with her accustomed valour in
the midst of the scuffle, and was then under Simon's protection.
Jerome, no longer anxious on her account, is about to retire to rest,
when a tremendous noise is heard on the staircase, and Oscar
rushes in, imploring shelter and concealment, and declaring himself
a state criminal. He had been to the Hotel de Ville with the
insurgents; Percheron and Comtois had recognised him, and, in
memory of his having stood treat at Ville d'Avray, had elected him
general on the spot. The Hotel de Ville taken, it was necessary to
appoint a government. A party of workmen established themselves
in a sumptuous saloon, on velvet cushions and rich carpets, to
deliberate on this important point. Percheron had his list cut and
44. dried in his head. It was heard with acclamation, at once adopted,
and inscribed upon a slate hung against the wall. The three first
names ran thus:—
Oscar, President of the Council.
Percheron, Minister of Finance.
Comtois, Minister at War.
Surprised by the national guards just after the issue of a decree
providing for its personal comforts, the new government was
suddenly broken up. Assisted by Comtois, who forced two or three
doors with his shoulder, Oscar escaped, pursued by horrible visions
of an army of police on his track, of capture, a dungeon, or perhaps
the scaffold. With the greatest difficulty Paturot persuades him that
his retreat is not an object of diligent inquiry on the part of the
executive, and that, during the day's brief anarchy, too many lists of
new governments have been drawn up for particular attention to be
paid to that, at whose head figures the name of the crack-brained
artist. As a good precaution, however, he advises Oscar to shave his
beard and his head, and take a course of cold douches, measures
calculated to mislead as to his identity, and to calm the
effervescence of his ideas.
But Oscar is incorrigible. A mob is for him an irresistible magnet. He
must join it, and, having joined it, he must swell the cry for the
crotchet of the hour. For a time (a long time Paturot calls it, in
consideration of the popular fickleness) the republic had been the
ruling mania, and held undisputed sway with the multitude. Alone
she waved her banners to the breeze, and filled the air with clamour,
defying opposition. Suddenly a new sound was borne upon the gale,
an echo of military glories not yet forgotten; a new standard was
unfurled, inscribed with the names of Austerlitz and Jena. "The
Empire raised its head; it had its emblems and its rallying-cries; it
had also its candidates. The manifestation was sudden as it was
unexpected. It had been thought that the Old Guard and the
Emperor were done with: the latter slept under the granite of the
Invalids; the former, sculptured on the Vendôme column, mounted
45. spirally towards heaven. Dear and sacred memories! why disturb you
by absurd pretensions? Why load you with the responsibility of
ridiculous enterprises? Your greatest honour, your highest title, is
your isolation in history, detached from past and future, like a
terrible and luminous meteor." The people did not reason thus. They
wanted change, a new toy, no matter what. Every night, from eight
to ten, crowds assembled on the boulevard near the gates of St
Denis and St Martin, (the old resort of the disaffected,) and
animated discussions went on. Groups were formed, orators stood
forth, the throng increased, the circulation was impeded, until at last
the armed force appeared and the mob dispersed. For some time
this was the order of every night. "Revolutionary emotions yielded
the ground to imperial emotions. Vincennes was eclipsed by the fort
of Ham. Was it calculation or impulse? Perhaps both: calculation on
the part of the chiefs, impulse and enthusiasm on that of the people.
Strange people, lovers of noise and gunpowder, who rush into the
street without a motive, and fight to the death ignorant why or
wherefore!"
Oscar was easily seized by the imperial mania. His dreams were of
dinners at the sovereign's table, of the run of the palace, princely
estates, and diamond snuff-boxes. According to him, art had never
received such patronage as from Napoleon: and he greatly
distressed and alarmed his friend Jérome, by spouting under gas-
lamps highly-coloured harangues concerning the marvels of the
imperial palace, and of the King of Rome's baptism. As Paturot drags
him away one evening from his al-fresco audience, they are followed
and accosted by Comtois, who carries them off to a wine-house, to
make an important communication to the general, as he persists in
calling Oscar since the memorable day at the Hotel de Ville. The
Emperor, he solemnly and mysteriously informs the friends, has
arrived in Paris. His exact whereabout in the capital is not known.
Some say he is in the lanterne at the Pantheon, examining the city
with his telescope; others are positive he has gone down into the
Catacombs at the head of 42,000 Indians: but the general opinion,
according to Comtois, is, that he has a plan for reducing Paris in
46. three minutes by the clock. Comtois is of such evident good faith,
that Paturot tries to undeceive him, telling him the Emperor is dead.
Thereupon the giant smiles contemptuously, and, when Jérome
persists, he looks upon him with suspicion. Then he condescends to
give the reason of his credulity. His father had served in the
dragoons of the Empress, and had stood sentry a hundred times at
Napoleon's door, had followed him to the wars, had never left him,
in short. "Comtois,"—these had been his last words to his son
—"when they tell you the Emperor is dead, answer at once 'It is a lie
of the enemy. The English spread the report; it is their interest to do
so.' Yes, my son, though you be alone and unsupported, always
maintain he is not dead, and add that he will come back. In the
court-yard of Fontainebleau he promised us he would, and he has
never broken his promise."—"You understand, general," concluded
Comtois to Oscar; "after that, there is not a word to be said. What
can you have stronger than that?—a dragoon of the Empress, a
mustache that grew gray in the service of the Emperor. It is
authentic, at any rate." In the midst of this curious conversation, a
private cab drives up to the door, and a gentleman sends in for
Comtois, who presently returns, his face beaming with joy. The
Emperor has inquired after him—after him, Comtois, native of
Baume-les-Dames, son of a dragoon of the Empress! Who would not
fight for such a man? Comtois is ready to empty his veins in his
service. In a few days the coronation will take place—the Pope will
come to Rheims on purpose—the Emperor has one thousand five
hundred millions in his pocket to distribute to the needy, and has
decided there shall be no more poor. All opposition will be in vain.
Comtois is well assured England will scatter gold in Paris to raise
opponents to Napoleon; but what then?—the imperialists are not
without means of stimulating the people. And thereupon Comtois,
after assuring himself there are no eavesdroppers, draws from under
his blouse—a magnificent stuffed eagle. With this on the top of a
flagstaff, and his father's uniform on his back, Comtois feels himself
invincible. Paturot is unfeeling enough to inquire if he proposes
exhibiting it for money. Comtois indignantly repudiates the idea. "It
is our banner, sir," he says; "our banner for the great day. By it the
47. sons of the Empire will be recognised. See the noble bird, the
glorious fowl! I have already cut a pole to stick it upon. As to the
tricolor flag, every body has got that. One government hands it over
to another. But the eagle! the eagle is not so easily tamed; it has but
one master, and that is the Emperor. The Emperor is come back, it is
the eagle's turn!"
And Comtois departed, ready to brave any odds on behalf of his
Emperor, and under shadow of the eagle's wing. "We have seen,"
says M. Reybaud, "how he understood the plot in which he was
associated. This illusion was common at the time. More than one
Parisian artisan, more than one villager of western France, believed
he deposited in the electoral urn a vote in favour of the Emperor.
The name preserved all its prestige, but did not delegate it. The
inheritance was too heavy to support. It resembled the iron crown;
none might touch it with impunity. There was much obscurity and
misconception in what then occurred; more than one appeal was
made to ignorance and credulity. The stuffed eagle had found a
victim, the living eagle made others. Ambition played its part, and
more than one personage beheld, in the perspective of the plot,
visions of grand-crosses and senatorships."
We find M. Reybaud too veracious, in other parts of the book, to cast
a doubt on his assertion that, in the year 1848, and in Paris, after
Napoleon's coffin has been opened at Courbevoie, and his corpse
deposited in the church of the Invalids, there still are to be found
men sufficiently stupid and credulous to believe the Emperor alive,
and to await his return. In the provinces, and especially in those
most remote from the capital, we know, from actual observation,
that within a very few years the Emperor's existence was an article
of faith with thousands, who, like Comtois, looked upon the report of
his death as a mere invention of the enemy. Although the imperial
veterans are now scarcely more plentiful in France than the
Peninsular heroes in this country, there still remain a sprinkling, who
infect their children and grandchildren with their own superstitious
fancies regarding Napoleon. The lower classes of provincial
48. Frenchmen are not remarkable for intelligence, and they receive the
traditions of the vieux de l'Empire, collected under the summer-
porch, and in the winter-night's gossip, with a sort of semi-credence
which a trifling corroborative circumstance ripens into implicit belief.
The mutilated, red-ribboned relic of the Grande Armée, who tells,
from beneath the shadow of the domestic vine, or from the bench at
the auberge door, such thrilling tales of past campaigns, of Austerlitz'
glory and Moscow's snows, shakes his gray head doubtingly when he
hears it said that Napoleon has perished, a captive and in solitude,
on a rock of the distant ocean. The gesture is not lost on the gaping
bumpkins, who greedily devour the old man's reminiscences. They
muse on the matter whilst tracing the next morning's furrow, or
perhaps, taken next day by the greedy conscription, they meet, at
the regiment, some ancient corporal who confirms the impression
they have received. The traditions of the barrack-room are all
imperial; how should they be otherwise? Were not those the days
when every recruit went to battle with a marshal's baton in his
havre-sack,—when no rank, honours, or riches were beyond the
grasp of the daring and fortunate soldier? The six years' service
expires; the soldier returns to his plough—an election arrives, the
name of Napoleon is every where placarded—interested persons tell
the newly-fledged voter, as the gentleman in the cab told Comtois,
that the Petit Tondu has returned to France. The soldat-laboureur,
whose prejudices are much strengthened, and his intelligence but
little brightened, by his term of military service, doubts, hopes, is
bewildered, and finally, in the uncertainty, votes for a stuffed bird
instead of a genuine eagle.
We have dwelt so long upon Jérome Paturot that we can afford but a
few lines to his brother in hosiery. Poor Monsieur Bonardin! Never,
since humanity first took to stocking-wearing, was a vender of that
useful article more scurvily treated than he was by the French
republic of 1848. The 25th of February beheld him a prosperous
man and an ardent republican,—"a republican of the morrow,"
certainly, but no worse for that; four months of liberty and fraternity
brought him to ruin and suicide. At first, all his anticipations are
49. rose-coloured. Increase of trade, an unlimited demand for hosiery,
must be the consequences of the new order of things. He is fully
persuaded great days are coming for the renowned establishment at
the sign of the Spinning Monkey. The day after the revolution he
opens his shop as usual, but only to be bullied by an ouvrier who
steps in to buy a red cap, finds none but white, curses Bonardin for
a Carlist, and carries off his national guardsman's musket. Uproar
recommences in the street; the shop is shut, and continues so for
some days. The end of the month arrives; there are payments to be
made, and M. Bonardin sends Criquet to the bank with bills for
discount—first-rate paper at short date. Criquet brings them back;
the best signatures no longer find cash. M. Bonardin is in all the
agonies of a punctual paymaster who sees a chance of his
signature's dishonour, when suddenly he is summoned to his duty as
national guard. On his return, after a sleepless night and a fagging
day, he has scarcely got amongst the blankets, when he is roused by
voices in the street calling out, in a measured chant, for lamps at his
windows.
M. Bonardin, awaking in alarm, and jumping out of bed—
What is that? (Cries in the street, 'Des lampions! des lampions!')
Good! here they are again with their infernal lamps! Impossible to
sleep under this republic!
Voices of boys in the street.—Hallo! first floor! Spinning Monkey!
Lamps! lamps!
M. Bonardin.—What a nuisance! (calling out)—Babet! Babet!
The boys shouting,—Lamps or candles!... break the ugly monkey's
windows, if he does not light up directly!
M. Bonardin.—Lord bless me!... Babet! Babet!...
Babet, (running in,)—What is it, sir?
M. Bonardin.—Don't you hear them? Cut a candle in eight pieces
directly. Not a minute to lose!
50. The boys.—It's a Carlisse, (Carlist.) Hallo, there! lamps or candles!
M. Bonardin, (in his nightgown, opening the window.)—Directly,
citizens, directly! A minute's patience!
The boys.—Ah! there's the old monkey himself! Bravo! bravo!
'D'un sang impur engraissons nos sillons!'
M. Bonardin, (flourishing his nightcap.)—Yes, yes, my friends, d'un
sang impur!... Certainly, by all means; Vive la République!
The boys.—Vive la République! Down with the Carlisses! (Babet
enters with candle-ends; M. Bonardin retreats behind his bed-
curtains.) Ah! there's the monkey's wife lighting up at last. Bravo!
bravo! Vive la République! The monkey's wife not bad-looking in her
night-dress!
Babet, (shutting the window.)—Do you hear, sir, those ragamuffins
call me your wife?
M. Bonardin.—Well! are you not flattered?
Babet.—Yes, indeed, the monkey's wife! It's flattering! They take me
for an ape, then?
M. Bonardin.—If they will only let me sleep at last. Midnight already.
Babet.—Pray, sir, is this to last long? This is our sixth illumination. A
whole packet of fives gone already!
M. Bonardin.—No, no, Babet—it is only the first moment. Recollect,
the republic is but ten days old.... A single decade, no more.
Babet.—A proper business it has been, your decade! Alarms at every
hour of the day and night; the shop shut three-quarters of the time,
and no buyers when it is open! A nice decade! And then the bank,
that refuses your paper; and then your bills, which you can't pay;
and then ...
51. M. Bonardin.—Let me sleep, my poor Babet.... All that is very true;
but what matter? We have got the republic; and you know as well as
I do—THERE ARE NO ROSES WITHOUT THORNS."
With this trite saying, the epigraph of the book, Bonardin, a bit of a
philosopher in his way, consoles himself, at the close of each
disastrous decade, for the annoyances and calamities he has
experienced in its course. These are countless, and of every kind.
Now it is a polite note from the tax-gatherer, requesting him to pay
down, in advance, the whole of the year's taxes, including an
extraordinary contribution just decreed by government. Then
Criquet, who has imbibed communist principles, insists on sharing
his master's profits, and M. Bonardin is afraid to refuse. Criquet,
however, is glad to fall back upon his wages, on finding that, instead
of profit, the shop leaves a heavy loss. Next comes a scamp of a
nephew, emancipated from Clichy by the abolition of imprisonment
for debt, who gets his uncle into various scrapes; and a drunken
godson, one Pacot, a soldier, who knocks his sponsor under the
table, on pretence of his being reactionary. Bonardin goes to Rouen
to assist at a wedding, and the railway takes him into a cross-fire,
the town being in full revolution. Rent-day arrives, and he sets out
as usual with receipts and a canvass-bag to collect the quarter's rent
from the occupants of the five upper stories of his house; but
nobody pays. The workman in the attics takes the receipt and
refuses the money, threatening to hang out the black flag if his
landlord insists. One tenant feigns madness—another declares
himself ruined—a third denies himself. Poor Bonardin returns home
with a heavy heart and an empty bag. In short, his misfortunes are
innumerable. He is mixed up in revolts against his will, and without
his knowledge; is sent to prison, thumped with musket-buts, hidden
in a cask, robbed in the national workshop. Finally, at the end of the
thirteenth decade, he stands upon the bridge leading to the National
Assembly, his face partly concealed by a handkerchief, singing
republican songs and asking alms. None give them. "I am a
proprietor, my poor man," says one; "I can give you nothing."
"Impossible, my good fellow," says the next; "I am a manufacturer."
52. "No change," says a third; "I am a shopkeeper, and I sell nothing."
"Sorry for you, my friend," replies another, "but I am an artist. In
these times, that is as much as to tell you I have not a sou in the
world." "Alas!" exclaims a fifth, "I would relieve you with pleasure,
but I am a poor employé, and the revolution has struck off a quarter
of my salary." "What ill luck!" cries Bonardin; "the revolution has
ruined every body, it seems. But this is about the time when the
representatives of the people repair to the National Assembly. They
are generous, the worthy representatives. The millions they daily
vote away sufficiently prove it. Courage! people who spend so many
millions will perhaps give me a few coppers." He is mistaken; the
deputies pass, but none give him any thing; whereupon he
concludes they have not yet received their five-and-twenty francs.
And as the republic will not give him bread, he resolves to seek
water in the river, climbs the parapet, and throws himself into the
Seine—thus tragically terminating the volume, which, up to that
point, is a farce, both broad and long, crammed with jokes and
double-entendres of various merit, but all exhibiting, in a light as
unfavourable as it is true, the disastrous effects of the revolution
upon the trade and prosperity of Paris.
We hoped to have included in this review the fourth volume of
Jérome Paturot, but it has not yet reached us, only a portion of it
being published. The work comes out in parts, and it is said the
fourth volume will be the last of the series. In that case, it will
probably close with the June revolt. If M. Reybaud likes, and dares,
he may find in subsequent events abundant food for his satirical
chronicle. Perhaps he will think fit to wait Cavaignac's exit before
criticising his performance. There are numerous points in the brief
history of the republic upon which he has not yet touched. We hope
yet to accompany Jérome to the cell of an imprisoned journalist, to
the court-martials upon the June insurgents, to debates in the
Assembly, and to consultations in the cabinet. A retrospective flight
to the days of the Convention, and an incidental inquiry into the
antecedents of M. Cavaignac the father, of whose exploits the son
has expressed himself so proud, were not without interest. But the
53. subject we are especially curious to see M. Reybaud take up, is that
of French journalism in 1848. He might fill a most amusing volume
with an elucidation of its mysteries and rivalries; and we cannot
believe, after reading the bold judgments and revelations contained
in the three published volumes of Jérome, that he would be deterred
from the task by apprehension of editorial wrath, whether expressed
in the field or in the feuilleton, by a challenge or a criticism.
54. PROPHECIES FOR THE PRESENT.
Prophecies and miracles, we are told, have long since ceased upon
the earth, as permitted only, by Divine goodness, to those ages
when faith was not firmly established, and revelation needed the
active and visible interference of Divine influence to make its way
into the heart of obstinate and denying man. This is a doctrine
which, in these present times of reason, we are naturally inclined to
accept. But yet there are circumstances, occurring even in our day,
which sometimes surprise the imagination, and even startle that
reason which is so ready to assert its supremacy. It is thus that we
have regarded with much curiosity, more wonder, and an impression
which it is difficult to drive away from our minds, certain strange
documents relative to the most important events of modern history,
which, if their authenticity be accepted, are among the most striking
revelations emanating from a prophetic spirit. They appear before us
avowed prophecies, coming from seemingly well-authenticated
sources, and backed by such assurances in the genuineness of their
antiquity, from credible mouths, as takes off from them that paulo-
post-future sort of suspicion, that inevitably attaches itself to
predictions, which make their appearance to the world after
fulfilment. In laying them before our readers, we are able to offer
some little proof, as far as it goes, in support of their authenticity;
and we still call to them the attention of those who may
nevertheless refuse their credence, as highly interesting documents
of a strange character, relating to past, present, and even future
political events. As they do, in truth, refer also to a future still to be
accomplished, as well as to the present, our readers, it is to be
hoped, may be able to judge for themselves how far the predictions
as to the future will bear out those which now already relate to the
past, and to what, if such an expression may be pardoned, might be
called the present just gone by.
55. Two of these revelations bear the character of direct and avowed
prophecies, given as such by holy men, and are imbued throughout
with that mystic spirit, which, however incomprehensible as regards
the future, becomes clear to an extraordinary degree of distinctness
when applied to the test of the past: they wear, in fact, the strange
air of predictions never intended to be comprehended until after
their fulfilment; as if, even although the inspired soul of certain
individual men had been permitted to raise itself, in its ecstasy, from
the earth into those unknown realms where past and future are
confounded in eternity, and shake off for the time the mortal
trammels of our limited understanding, but retain still afterwards the
consciousness and the power to reveal what there it saw; yet, by
some mysterious dispensation, the revelations should not be allowed
to be expounded in the clearness of their truth, so as to be
comprehensible to the intellects of the uninspired and undeserving
herd. Why, then, should the future be revealed, it might be asked, if
the revelation should serve nothing to mankind? With such deep and
awful mysteries we have not to deal: we cannot answer: we are of
the blind who cannot lead the blind. At all events, if these
documents be forgeries—mere devices fabricated after facts—and
that they cannot be so entirely, will be seen hereafter—certainly a
degree of genius that is almost incomprehensible presided over their
fabrication, with this strange stamp of vague oracular language,
which is only comprehensible in its after-application.
Such are two of these prophetic writings. As they are supposed to
proceed from the mouths of religious men, renowned for the sanctity
of their lives, they naturally refer more to the condition of the
Christian church, and to the fate of the "faithful," than immediately
to political events; but yet so closely is the destiny of the faithful of
the Christian world mixed up inevitably with the destiny of men and
countries in general, that the political events of our day are there set
down in prediction, with all the minuteness which the vague and
mystic language of prophetic revelation, dimly depicting what even
the inspired eye can only dimly trace in cloudy vision, "through a
glass darkly," is able to bestow upon detail. The third revelation
56. assumes to be no more than an interpretation of the prophetical
book of the New Testament, and repudiates all supposition of aiming
at any spirit of prophecy in itself; a portion, however, of this
interpretation of a part of Scripture so obscure as the book of the
Revelation, is so remarkable in its application to present events, as
to wear the very air of prophecy that its interpreter repudiates.
The longer and more important of the two prophecies, which have
both appeared in France, and refer chiefly to events immediately
connected with French history, is one popularly designated as the
"Prophecy of Orval:" it has been already translated into English, and
published,[12] with a preface, an introduction, and explanatory
notes, chiefly referring to the authenticity of the document, and to
its possession in the hands of a variety of credible and respectable
persons during the whole of the present century, and some of the
later years of the last. The little pamphlet has been got up with
much intelligence, and apparently with a strictly conscientious spirit.
We cannot here follow the editor through all the details he lays
before us, to prove that the prophecy has been copied from a book
printed at Luxembourg in the year 1544, and recopied, by gentlemen
of standing and respectability, from copies already made, as early as
the year 1792—or through all the evidence adduced, some years
ago, in such respectable religious French papers as the Invariable,
and the Propagateur de la Foi, accompanied by notes from the editor
himself, with regard to his own personal experience, and the
testimony he has received from personages worthy of the highest
credit, known to himself. It may be said, however, that he
communicates extracts of letters and other authorities, which, could
they be forgeries, would assuredly be some of the most ingenious of
the kind, even if they had any great end or aim in their fabrication;
and it ought to be added, that a great part of this testimony is
compiled from a brochure called The Oracle for 1840, and published
by a certain Henry Dujardin in Paris, in the month of March 1840,
consequently anterior, at all events, to the remarkable circumstances
of the present day. On these matters we must refer our readers to
the interesting little pamphlet itself. The authority upon which rests
57. the fact that the prophecy, generally known under the title of "Les
Prévisions d'Orval," and entitled "Certain Previsions revealed by God
to a Solitary, for the Consolation of the Children of God," was
actually printed at Luxembourg in the year 1544, seems every way
as conclusive as possible in such matters of ancient lore; and the
writer of this present paper has only to add that he himself has seen
in Paris the whole prophecy, as far as it is still in existence, printed in
a newspaper of the year 1839, (he believes, as far as his memory
reaches, in the Journal des Villes et des Campagnes), and
consequently, to his own knowledge, published to the world
previously, at least, to the events of the present year; that an old
English lady, upon whose faith he can implicitly rely, positively
declared to him that she had it in her hands as early as the year
1802, and thus even before the crowning of Napoleon as Emperor;
and that its reappearance, since the breaking out of the revolution of
this year, excited so much sensation in the French capital, that
measures were taken by the republican government of the day to
establish a sort of surveillance over persons known to possess and
propagate the prediction—a fact also mentioned by the editor of the
English pamphlet—as conspirators against the stability of the
republic. With these premises, we proceed to do no more than lay
before our readers the prophecy in question, claiming for the notice
that follows such credence as every man's conviction or scepticism,
imagination or cooler reason, may choose to bestow.
The Abbey of Orval, from which the prediction has taken its title,
was, it appears, a religious institution, situated in the diocese of
Treves, on the frontiers of Luxembourg; and it is said that the abbot
and the monks, when they fled from their convent, during the siege
of Luxembourg by the French revolutionary army, to the "refuge" in
the town, conveying a part of their archives as well as their sacred
vessels with them, first communicated the printed copy of the
Previsions of a Solitary of 1544 to Marshal Bender, who commanded
the army, and other French gentlemen, by whom copies were then
taken as a matter of curiosity, and put in circulation. Tradition at that
time attributed the prediction to a monk of the name of Philip
58. Olivarius, although the exact period of the existence of the "Solitary"
does not appear to have been well known. What at present remains,
or is supposed to remain, commences only with the history of
Napoleon Buonaparte, although the "Oracle" of Henri Dujardin
speaks of the prediction relative to the death of Louis XVI. as having
excited considerable sensation among the emigrant circles of that
time; and the circumstance of the absence of any events anterior to
the prophecy, as it stands at present, is accounted for by a remark
made in the Propagateur de la Foi, that, when it was discovered, at
the conclusion of the last century, the copyists generally neglected to
transcribe what related to the past, and contented themselves only
with that portion, the accomplishment of which was still to come.
The prophecy, as will be seen, astoundingly and suspiciously minute
in its details; but yet, when the predictions as to the future are
considered—to our eyes at present so vague and mysterious, and
still perhaps in their fulfilment, if so it should prove, as exact in
detail,—it may well be imagined that the portions which now refer to
the past, may in their day have appeared equally mysterious and
vague. It runs as follows, as it now stands:—
"At that time a young man, come from beyond the sea into the
country of Celtic Gaul, shows himself strong in counsel. But the
mighty to whom he gives umbrage will send him to combat in the
land of Captivity. Victory will bring him back. The sons of Brutus will
be confounded at his approach, for he will overpower them, and
take the name of emperor. Many high and mighty kings will be sorely
afraid, for the eagle will carry off many sceptres and crowns. Men on
foot and horse, carrying blood-stained eagles, and as numerous as
gnats in the air, will run with him throughout Europe, which will be
filled with consternation and carnage; for he will be so powerful, that
God shall be thought to combat on his side. The church of God, in
great desolation, will be somewhat comforted, for she shall see her
temples opened again to her lost sheep, and God praised. But all is
over, the moons are passed."
59. It must be remarked here, that the moons, continually alluded to in
the prophecy, may be found, by the calculation of thirteen lunar
mouths to a year, to arrive at an extraordinary accuracy of prediction
as to the date of the events prophesied: those which have been
mentioned above must be considered to refer probably to a period of
time alluded to in the portion of the "Previsions" supposed to be lost.
"But all is over; the moons are passed. The old man of Sion cries to
God from his afflicted heart; and behold! the mighty one is blinded
for his crimes. He leaves the great city with an army so mighty, that
none ever was seen to be compared to it. But no warrior will be able
to withstand the power of the heavens; and behold! the third part,
and again the third part, of his army has perished by the cold of the
Almighty. Two lustres have passed since the age of desolation; the
widows and the orphans have cried aloud to the Lord, and behold!
God is no longer deaf. The mighty, that have been humbled, take
courage, and combine to overthrow the man of power. Behold, the
ancient blood of centuries is with them, and resumes its place and
its abode in the great city; the great man returns humbled to the
country beyond the sea from which he came. God alone is great!
The eleventh moon has not yet shone, and the bloody scourge of
the Lord returns to the great city; the ancient blood quits it. God
alone is great! He loves his people, and has blood in abhorrence; the
fifth moon has shone upon many warriors from the east. Gaul is
covered with men, and with machines of war; all is finished with the
man of the sea. Behold again returned the ancient blood of the Cap!
God ordains peace, that His holy name be blessed. Therefore shall
great peace reign throughout Celtic Gaul. The white flower is greatly
in honour, and the temples of the Lord resound with many holy
canticles. But the sons of Brutus view with anger the white flower,
and obtain a powerful edict, and God in consequence is angry on
account of the elect, and because the holy day is much profaned;
nevertheless God will await a return to Him during eighteen times
twelve moons. God alone is great! He purifies His people by many
tribulations; but an end will also come upon the wicked. At this time
a great conspiracy against the white flower moves in the dark, by
60. Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
textbookfull.com