Classificació

He dedicat gairebé tot el dia a acabar el nou format del blog. És possible que hi acabi afegint algo. Però ara per ara la idea que porto al cap la dono per tancada. És a dir, que la re-estructuració en la forma d’accedir i visualitzar els continguts queda totalment separada en les tres seccions que ja he estat comentat.

Ara només entrar al blog com podeu veure en el menú principal es pot escollir de forma senzilla el poder veure tots els contiguts, només els de tecnologia, creixement personal o els personals. Així quan algú entri amb una idea concreta desitjo que li sigui més senzill trobar el que busca.

Finalment a la part superior podeu trobar els menús que hi havia abans a la barra principal.

Apa doncs, a disfrutar-ho.

What is AMQP? and the architecture

What is AMQP? (Advanced Message Queuing Protocol)

When two applications need to communicate there are a lot of solutions like IPC, if these applications are remote we can use RPC. When two or more applications communicate with each other we can use ESB. And there are many more solutions. But when more than two applications communicate and the systems need to be scalable the problem is a bit more complicated. In fact, when we need to send a call to a remote process or distribute object processing among different servers we start to think about queues.

Typical examples are rendering farms, massive mail sending, publish/subscriptions solutions like news systems. At that time we start to consider a queue-based solution. In my case the first approach to these types of solutions was Gearman; that is a very simple queue system where workers connect to a central service where producers have to call the methods published by workers; the messages are queued and delivered to workers in a simple queue.

Another interesting solution can be use Redis like a queue service using their features like publish/subscribe. Anyway always you can develop your own queue system. Maybe there a lot of solutions like that but when you are interested in develop in standard way and want a long-run solution with scalability and high availability then you need to think in use AMQP-based solutions.

The most simple definition of AMQP is: “message-oriented middleware”. Behind this simple definition there are a lot of features available. Before AMQP there was some message-oriented middlewares, for example, JMS. But AMQP is the standard protocol to keep when you choice a queue-based solution.

AMQP have features like queuing, routing, reliability and security. And most of the implementations of AMQP have a really scalable architectures and high availability solutions.

The architecture

The basic architecture is simple, there are a client applications called producers that create messages and deliver it to a AMQP server also called broker. Inside the broker the messages are routed and filtered until arrive to queues where another applications called consumers are connected and get the messages to be processed.

When we have understood this maybe is the time to deep inside the broker where there are AMQP magic. The broker has three parts:

  1. Exchange: where the producer applications delivers the messages,  messages have a routing key and exchange uses it to route messages.
  2. Queues: where messages are stored and then consumers get the messages from queues.
  3. Bindings: makes relations between exchanges and queues.

When exchange have a message uses their routing key and three different exchange methods to choose where the message goes:

    1. Direct Exchange:  routing key matches the queue name.
    2. Fanout Exchange: the message is cloned and sent to all queues connected to this exchange.
    3. Topic Exchange: using wildcards the message can be routed to some of connected queues.

This is the internal schema of a broker:

ssh-copy-id

Really useful command of ssh package to add public key of your user account to a remote SSH server and then access there with passwordless authentication method.

ssh-copy-id [-i [identity_file]] [user@]machine

In the past I wrote a simple cookbook to explain this process but now this is as simple as possible. Don’t forget ssh-copy-id is the most easy way to add your ssh public key in remote servers.

AMQP and RabbitMQ [TOC]

After reading the book ‘RabbitMQ in action‘ I’m working on series of posts  that will include the following subjects:

  1. What is AMQP? and the architecure
  2. Deep inside AMQP
  3. RabbitMQ CLI quick reference
  4. Hello World using ‘kombu’ library and python
  5. Parallel programming
  6. Events example
  7. RPC
  8. Clustering fundamentals
  9. Managing RabbitMQ from administration web interface
  10. Managing RabbitMQ from REST API

Please let me know if you are interested in this series of posts. Because in my opinion this is very interesting and it always comes in handy to know if someone has been working on those subjects.

Getting help to configure spamassassin.conf

Configure spamassassin is never easy to do. But when you look for information in Google usually you will be mad . The most common help method in linux is use ‘man command’ but it doesn’t work or information is not enough usually.

After a lucky search I found this command to get an extended information about how to configure spamassassin.conf file.

perldoc Mail::SpamAssassin::Conf

WordPress plugin: permalink editor

When your are using custom permalinks for posts in wordpress you can have problems to use permalinks in wordpress pages; because rewrite rules can’t work properly for both: posts and pages.

In my case permalink editor plugin has been the definitive solution.

Next you can see new permalink configuration form in wordpress after installing permalink editor:

UPDATE 2017-08-07, interesting alternative ultimate guide to blog readability.

Scroll to Top