1、下载安装

 

http://rocketmq.apache.org

下载编译好的zip包,解压即可

2、启动运行

在bin目录下运行mqnamesrv程序

 ./mqnamesrv

运行mqbroker

 ./mqbroker -n localhost:9876

这里的mqnamesrv启动端口默认是9876。这个是硬编码写在代码里面的。

 

org.apache.rocketmq.namesrv.NamesrvStartup文件中找到一下代码

 

final NettyServerConfig nettyServerConfig = new NettyServerConfig();
        nettyServerConfig.setListenPort(9876);
        if (commandLine.hasOption('c')) {
            String file = commandLine.getOptionValue('c');
            if (file != null) {
                InputStream in = new BufferedInputStream(new FileInputStream(file));
                properties = new Properties();
                properties.load(in);
                MixAll.properties2Object(properties, namesrvConfig);
                MixAll.properties2Object(properties, nettyServerConfig);
                namesrvConfig.setConfigStorePath(file);
                System.out.printf("load config properties file OK, %s%n", file);
                in.close();
            }
        }

 

比较有意思的,是居然是吧端口直接写在代码里面,而不是从配置文件里面读取的。另外在下面在判断启动命令中是否有c命令,如果有,加载指定的配置文件,通过反射设置对应的属性。

或者是直接直接在启动命令行去增加参数

通过以下代码实现

MixAll.properties2Object(ServerUtil.commandLine2Properties(commandLine), namesrvConfig);

 

不仅仅mqnamesrv的代码是这样实现的,我们可以看到broker也是这么干吗,先硬编码一个端口10911,然后在检查启动指定的配置文件,这种做法也是常见的。

  • 测试消息生产:

./tools.sh org.apache.rocketmq.example.quickstart.Producer

  • 测试消息消费

./tools.sh org.apache.rocketmq.example.quickstart.Consumer

  • Rocketmq有哪些角色

1>、namesrv: 用作服务发现,连接broker,producer,consumer

2>、broker: mq的本身,消息的生产和消费都通过broker完成

3>、producer:消息的生产者

4>、consumer:消息的消费者

  • 消费方式

1>、集群模式:

broker把消息发送给consumer集群,每个消息只能被消费一次

2>、广播模式:

每条消息都会被订阅的consumer消费。

  • java实现消息的发送:

1>单条发送send

2>批量发送 send

3>异步发送sendCallback

4>只管发送,,不管结果sendOneWay

不难理解这几个定义,就如同字面含义一样的,在速度方面4>3>2>1,因为4不需要知道结果,只管发送,不管成功鬼使白,3异步发送按照正常理解肯定比同步要快,2批量肯定咋速度上要大于单条发送。

 

2,950 对 “RocketMQ(一)初步认识”的想法;

  1. Magnificent goods from you, man. I’ve take into accout your stuff prior to
    and you are just too excellent. I really like
    what you have received right here, really like what you’re saying and the way in which during which you assert it.
    You’re making it enjoyable and you still take care of to
    stay it wise. I cant wait to learn much more from you.
    That is really a great web site.

    Also visit my webpage :: CBD for dogs

  2. Heya exceptional website! Does running a blog such as this require a lot of work?
    I’ve no expertise in computer programming but I had been hoping to start my own blog soon. Anyway, should you
    have any ideas or techniques for new blog owners please share.
    I understand this is off topic nevertheless I just had to ask.
    Kudos!

  3. I am no longer certain the place you are getting your information, however good topic.
    I must spend some time studying more or figuring out more.
    Thanks for great information I used to be looking for this info for my mission.

  4. “Right here is the right web site for everyone who really wants to find out about this topic. You know so much its almost tough to argue with you (not that I personally would want toÖHaHa). You certainly put a brand new spin on a topic that has been written about for ages. Excellent stuff, just excellent!”
    נערות ליווי בלוד

  5. “When I initially commented I appear to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I get four emails with the exact same comment. Perhaps there is a way you can remove me from that service? Kudos!”
    נערות ליווי

  6. I’m no longer certain where you are getting your info,
    however great topic. I needs to spend a while learning more or figuring
    out more. Thanks for great info I used to be on the lookout for this information for my mission.

  7. What’s up it’s me, I am also visiting this website on a regular basis, this site
    is in fact pleasant and the visitors are genuinely sharing nice thoughts.

  8. Please let me know if you’re looking for a writer for your site.
    You have some really good articles and I believe I would be a good asset.

    If you ever want to take some of the load off, I’d really like to write some content for your blog in exchange for a link back to mine.

    Please send me an e-mail if interested. Many thanks!

  9. Sosyal medya platformları arasında büyük bir kitleye sahip olan TikTok, birçok kişinin ilgisini
    toplayan bir platform olmayı başardı.
    Uygulama aracılığı ile birçok insana videosunu ulaştıran kişiler, beğeni toplayarak kendi profillerini
    tanınmış bir hale getirmek için uğraşıyorlar
    TikTok Takipçi Satın Al Konusunda uzman kadrosu ile sizleride popüler etmek için var !

  10. You will come away deeply revitalized and with the confidence to bring these Tantric practices to your students. Teachers will get a certificate for 100 continuing education hours or as a module of the YTT 300. Join this world-renowned teaching team, Yogrishi Vishvketu and Yog Sundari and Guest Teachers for 72 hours of Live online teaching and a range of other learning support tools to fully integrate your learning throughout the course. This is a rare opportunity to participate in one of our advanced modules right from your home location, in which the 100-hour module can be counted toward your YTT 500 accreditation. https://akhandayoga.com/ We offered our Raj Yoga module virtually last summer to great success and many of the students found their focus and engagement with teachers and other students was actually enhanced in the interactive online format. Shiva Shakti Power is designed to be an intensive, providing you with an embodied and practical understanding of Classical Kundalini Yoga. The course will take place over two weekends followed by a six-day intensive from April through mid-May. Classes take place on Zoom as four 1.5-hour sessions per day. Class time is posted in Pacific Time (LA Time), but is accessible to people in time zones anywhere from LA to Milan. Have you been practicing or even teaching Yoga for a while and want to explore Ayurveda and how to work its magic for radiant living in alignment with your constitution? Understanding Ayurveda more deeply will help you bring Yoga into all areas of your life and help teachers identify the most effective techniques to help individual students achieve balance and wellness.

  11. Thanks for another informative site. The place else may
    I am getting that kind of information written in such a perfect manner?
    I have a venture that I’m simply now operating on,
    and I’ve been on the glance out for such information.

    Here is my webpage; cbd products

  12. Takipçi Satın Alma Hizmetlerinden instagram Takipçi Satın Al

    İnstagram’da bir hesabın takipçi adedi, ve o
    hesabın takipçi sayısı sizi müşterilerinize
    daha iyi tanıtmış olmaktadır, ve bu prestije sahip
    olmak isteyen iş sahipleri
    ilk olarak takipçi satın almaktadır. Fazla takipçi adedi olan hesaplar, daha çok ilgi çeker
    ve daha çok şahsa ulaşırlar.
    Firma, müşterilerin değişik taleplerine
    yanıt sunabilcek adına değişik takipçi paketleriyle hizmet veriyor
    Takipçi satın al
    için herkesin bütçesine uyacak paketler sunuyor.
    En güvenilir şekilde ödemenizi gerçekleştirebiliyorsunuz.

    .

  13. This is the perfect site for anyone who really wants to understand this topic.
    You know so much its almost tough to argue with you (not that I really would want to…HaHa).
    You certainly put a fresh spin on a topic that’s been discussed for a long time.
    Excellent stuff, just excellent!

  14. Hello fantastic website! Does running a blog such as
    this take a large amount of work? I’ve no knowledge of
    programming but I had been hoping to start my own blog in the near future.
    Anyhow, should you have any suggestions or techniques for
    new blog owners please share. I understand this is off topic but I simply wanted to ask.
    Cheers!

  15. After looking at a number of the blog articles on your web site, I honestly like your
    technique of blogging. I saved as a favorite it to my bookmark website list and
    will be checking back in the near future. Take a look at my website too
    and tell me how you feel.

  16. Do you mind if I quote a couple of your posts as long as
    I provide credit and sources back to your webpage?
    My blog site is in the very same area of interest
    as yours and my visitors would really benefit from some
    of the information you provide here. Please let me know if this alright with you.
    Many thanks!

  17. Wonderful site you have here but I was curious about if you knew
    of any community forums that cover the same topics talked about here?
    I’d really love to be a part of group where I can get advice
    from other experienced individuals that share the same interest.
    If you have any suggestions, please let me know.
    Bless you!

  18. Instagram aktif takipçi satın alarak siz de fenomen olabilirsiniz,
    fakat fenomen olmak isterken aynı zaman da bu işlemleri yapacağınız yerin kalitesi çok önemlidir bunu
    unutmayınız. Türk takipçi yazarak yabancı takipçi atılırsa hesabınıza
    bu sizin hesabınızın gerek görüntü gerek keşfete düşme gibi olasılıklarınızı tamamen bitirecektir.

    Bu yüzden aktif takipçi almanız çok önemli, aynı zamanda tabiki güvenilirlik ön planda olmalıdır.

    Biz uzman ekibimiz ile sizlere en iyi hizmeti vermek
    için sürekli çalışmaktayız. En iyi takipçi beğeni
    izlenme gibi sizleri üst seviyeye çıkarmak için elimizden geleni yaptık ve yapmaya devam edeceğiz.

    Ucuz Instagram takipçi için bizimle de iletişime geçebilirsiniz.

    Instagram bot takipçi içinde geçebilirsiniz fakat bunlara garanti vermemekteyiz,
    bot takipçilerin kesinlikle garantisi yoktur bir kaç gün içerisinde
    hepsi Instagram tarafından silinebilir.
    En aktif siteden hemen sende instagram aktif takipçi satın al

  19. Instagram takipçi hizmetlerinden yararlanabilmek amacıyla ilk olarak istenilen hizmetin tercihinin yapılması gerekmektedir.

    Sonra ise shopier ekranında sadece kullanıcı
    adınız ve 3d ödeme yöntemi ile ödeme yapmanız gerekmektedir.

    Burada doğru bulguların girildiğinden emin olunması, hizmet yönünden problem yaşamamak amacıyla
    önemlidir.
    Her yaştaki isteyen herkes Takipçi satın al işlemi takip2018 den yapabilirler.

  20. Greetings from Florida! I’m bored to death at work so
    I decided to check out your blog on my iphone
    during lunch break. I love the information you provide here and can’t wait to take a look when I get home.

    I’m surprised at how fast your blog loaded on my mobile ..
    I’m not even using WIFI, just 3G .. Anyhow, great site!

  21. Takipçi Satın Al Seçenekleri ile takip2018 eşsiz benzersiz hizmetler sunuyor.

    Şirketin hizmetlerinden faydalanarak dilediğiniz kadar takipçiye ulaşabilirsiniz, https://tiny.cc/takipcisatinal işlemi oldukça
    basit ve kısa süreçte size teslim edilmektedir.

    Yapmanız gereken tek şey Takip2018.com a sadece giriş yaparak dilediğiniz kadar takipçi isteği yapabilirsiniz.

    Size uygun paketi seçmeniz halinde dilediğiniz alabilir ve sadece izlersiniz.
    Benzersiz hizmet vererek size daha çeşitli paketler önerebiliyor.

  22. Each Monday during the NBA season, All Tar Heels will review the prior week for each Tar Heel in the NBA and preview the week ahead. This week, we are looking at games from April 12-18 and looking ahead to games from April 19-25.

  23. Oh my goodness! Awesome article dude! Thank you, However I
    am going through problems with your RSS. I don’t know why I cannot
    subscribe to it. Is there anybody getting identical RSS issues?

    Anybody who knows the solution will you kindly respond?
    Thanks!!

  24. Do you mind if I quote a couple of your posts as long as
    I provide credit and sources back to your blog? My blog is in the
    very same niche as yours and my users would truly benefit from a lot of the information you provide here.
    Please let me know if this okay with you. Thanks!

  25. Hey there just wanted to give you a brief heads up
    and let you know a few of the images aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different
    web browsers and both show the same outcome.

  26. Have you ever considered writing an ebook or guest authoring on other
    blogs? I have a blog based on the same ideas you discuss and would love to have you share
    some stories/information. I know my viewers would enjoy your
    work. If you are even remotely interested, feel free to send me an e-mail.

  27. I loved as much as you’ll receive carried out right here.
    The sketch is attractive, your authored subject matter stylish.
    nonetheless, you command get got an nervousness over that
    you wish be delivering the following. unwell unquestionably come more formerly again as exactly
    the same nearly a lot often inside case you shield this increase.

  28. Great post. I was checking constantly this blog and I’m impressed!
    Very helpful information specially the last part 🙂 I care for such information a lot.

    I was seeking this certain info for a long time. Thank you and best of luck.

  29. I think that is one of the such a lot vital information for
    me. And i am satisfied reading your article.
    But want to commentary on few basic things, The
    website style is ideal, the articles is truly nice : D.
    Good activity, cheers

  30. Takipçi Satın Alarak İşini Büyüt!

    Instagram’da nasıl takipçi kazanacağınızı anlamaya başlamadan önce,
    en önemli adımlardan biri hesabınızın tamamen optimize edilmesidir.

    Markanızın Instagram biyografisini hesabınızın aynası olarak düşünebilirsiniz.

    Instagram takipçi satın almak isteyen kullanıcıları, öncelikle
    profillerinde ne kadar takipçi istediklerine yönelik karar
    vermeleri gerekmektedir.
    İnstagram hesaplarınızda güçlü bir etkiye sahip olmak istiyorsanız takipçi sayınızı
    en kaliteli yaani Türk takipçi satın al işlemi yaparak belirli
    bir düzeye getirmelisiniz.
    Türk takipçiler tamamen organik olarak site üzerinde
    satışa sunulmuştur : https://cutt.ly/takipcintrcom

  31. This design is incredible! You definitely know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!)
    Wonderful job. I really loved what you had to say, and more than that, how
    you presented it. Too cool!

  32. I was pretty pleased to find this page. I want to to
    thank you for ones time just for this wonderful read!!

    I definitely enjoyed every bit of it and I have you bookmarked to see new stuff in your site.

  33. Retinol SERUM

    HC Retinol Serum: Bir A vitamini formu olan Retinol,
    ince çizgilerin ve yaşlanma belirtilerinin görünümünü azalttığı klinik olarak
    kanıtlanmış güçlü bir aktiftir.

    Retinol aynı zamanda leke oluşumuna ve ciltteki ton eşitsizliklerine
    karşı mücadele eder. Canlı, taze ve daha genç bir cilt görünümü
    kazandırmaya yardımcı olur.

    HC Retinol Serum’un, en ileri düzeyde konsantre edilmiş saf Hyaluronik Asit, Pentavitin (Saccharide Isomerate), Anadenanthera Colubrina
    Bark Extract ve Bisabolol ile güçlendirilmiş aktif içeriği,
    güçlü nemlendirici ve canlandırıcı özelliği
    sayesinde cildi sıkılaştırmaya yardımcı olur.

    HC Retinol Serum akneli ve yağlı ciltlerde, lekelerde ve ciltte
    oluşan A Vitamini eksikliğinde kullanılır.

    Bu tür ciltlerde daha iyi bir etki alınabilmesi için HC Çay Ağacı (Tea
    Tree) Temizleme Jeli ile birlikte kullanılması tavsiye edilir.

    https://rebrand.ly/retinolserum

  34. С помощью сайта компании https://stanokchpu.ru/ можно найти поставщиков, которые закупают станки из разных стран. Плазменная резка металла, мрамора и волокна отныне становятся действительно простыми. Станок купить тут можно дешево, а обслуживание приобретенного оборудования, на которое предоставляется нужная гарантия, совершенно не вызывает проблем. Режущие плоттеры и лазерные агрегаты, изготовленные в разных странах, всегда будут функционировать добротно.

  35. Портал о магии http://vsemagi.ru/ будет интересен тем, кто хочет изменить свою жизнь, узнать о грядущих событиях, получить ответы на волнующие вопросы. На сайте собрано большое количество информации о магических амулетах, экстрасенсах, целителях, талисманах. Здесь вы узнаете, как снять порчу, венец безбрачия, как использовать привороты и отвороты. На сайте можно заказать обучающие книги по нумерологии, астрологии, хиромантии, а также карты и другие товары для гадания.