Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Erfahrungen mit Queues — von ActiveMQ über Hazelcast zu Disque

Erfahrungen mit Queues — von ActiveMQ über Hazelcast zu Disque

Queues werden häufig in verteilten Systemen verwendet, um Komponenten zu entkoppeln und die parallele Verarbeitung von Aufgaben zu ermöglichen. Im Gegensatz zu Datenbanken genießen Queues jedoch relativ wenig Aufmerksamkeit — dieser Vortrag soll dieses Problem beheben.

Wir sehen uns an, welche Aufgaben Queues in verteilten Systemen übernehmen können und welche allgemeinen Eigenschaften sie aufweisen. Danach diskutieren wir den Anwendungsfall von Electronic Data Interchange (EDI) — Daten werden über verschiedene Konnektoren empfangen, parallel verarbeitet und abschließend wieder weiterversendet.

Wir haben begonnen mit ActiveMQ zu arbeiten, was funktioniert, aber einige Nachteile mit sich bringt. Danach haben wir Hazelcast entdeckt, das alle Probleme zu lösen schien. Nur um danach festzustellen, dass wir die Probleme gegen andere eintauschen. Glücklicherweise wurde kürzlich Disque veröffentlicht, das sehr vielversprechend aussieht. Obwohl der Code noch nicht stabil ist, haben wir bereits teilweise darauf umgestellt mit vielversprechenden Resultaten.

Philipp Krenn

April 06, 2016
Tweet

More Decks by Philipp Krenn

Other Decks in Programming

Transcript

  1. para//el 2016 Erfahrungen mit Queues von ActiveMQ über Hazelcast zu

    Disque Philipp Krenn̴̴̴̴̴̴̴̴̴̴̴@xeraa
  2. Architektur +--------+ | | +----+ | +--------+ | | |

    | | | | | | | +--------+ v + | | | | | | +------------> Verarbeitung +-|-|----+ | | + | | | | | +-|------+ | | | | <--------------+ +--------+ Schnittstellen
  3. Datenfluss Camel Komponente / Protokoll-Implementierung + ^ | | |

    | v + Camel Routing + ^ | | | | v + Queue + ^ | | | | v + Verarbeitung
  4. !

  5. !

  6. Networked message queues like ActiveMQ, RabbitMQ, ZeroMQ, and a host

    of other Java inspired software tumors are crutches of systems design. — Ted Dziuba, http://widgetsandshit.com/teddziuba/2011/02/the-case- against-queues.html
  7. There are only two hard problems in distributed systems: 2.

    Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery — Mathias Verraes, https://twitter.com/mathiasverraes/status/ 632260618599403520
  8. <bean id="mysql-ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="jdbcUrl" value="jdbc:mysql://{{rds.hostname}}:3306/{{rds.activemq.database}}"/>

    <property name="username" value="{{rds.activemq.user}}"/> <property name="password" value="{{rds.activemq.pass}}"/> <property name="validationTimeout" value="5000"/> <property name="minimumIdle" value="2"/> <property name="maximumPoolSize" value="20"/> <property name="idleTimeout" value="600000"/> <property name="maxLifetime" value="1800000"/> <property name="initializationFailFast" value="false"/> <property name="allowPoolSuspension" value="false"/> <property name="dataSourceProperties"> <props> <prop key="relaxAutoCommit">true</prop> <prop key="socketTimeout">10000</prop> <prop key="connectTimeout">10000</prop> <prop key="useJDBCCompliantTimezoneShift">true</prop> </props> </property> </bean>
  9. In-memory data grid Sets, Listen, Maps, Queues, Topics, Locks, Atomic

    Long,... Query, Aggregate, MapReduce Hibernate 2nd Level Cache, Session Replication
  10. Weniger gut Wenige Anwender der Queue- Komponente Bugs bei IP

    / DNS Änderungen Stop-the-World Upgrades
  11. Currently our action is to create bug for these scenarios

    and try to ensure exactly-once. — Enes Akar, https://groups.google.com/forum/#!msg/hazelcast/ u_KLHVnvT_U/Qx5Km8COk_oJ
  12. In the event of network failure (or a node crashing),

    messages can be duplicated, and consumers must be prepared to handle them. — https://www.rabbitmq.com/reliability.html
  13. [...] no one try to use N Redis independent nodes

    and the offered primitives as a building block for a distributed system [...] — Salvatore Sanfilippo, http://antirez.com/news/78
  14. WARNING: This is beta code and may not be suitable

    for production usage. — https://github.com/antirez/disque
  15. Bilder · Schnitzel https://flic.kr/p/9m27wm · Architektur https://flic.kr/p/6dwCAe · Conchita https://flic.kr/p/nBqSHT

    · Papier https://flic.kr/p/83thLf · Lu!brücke https://commons.wikimedia.org/wiki/ File:C-54landingattemplehof.jpg · Bier https://flic.kr/p/aBSmtY · Eierlegende Wollmilchsau https://flic.kr/p/GzQTT · Li! https://flic.kr/p/iBNr9x