ngx-message-queue
A message queue library for Angular 2+ application components to communication each other.
ngx-message-queue
library supports message headers and message payload. It also supports message selectors for subscribers to subscribe to only messages with specific message header via msgSelector.
Selectors are a way of attaching a filter to a subscription to perform content based routing. Selectors are typically apply to message headers, If no headers are attached to the message then all the messages will be delivered to subscriber by default. If subscriber is not configuring the msgSelector then all the messages will be delivered to the subscribers i.e. no filters are applied.
Multiple conditions are allowed in the msgSelector.
ngx-message-queue was previously knowns as ng2-message-queue.
Multiple conditions are allowed in the msgSelector.
ngx-message-queue was previously knowns as ng2-message-queue.
Example of a message selectors
LogLevel= fatal
age > 13
age>=13 & gender=M
Filter expression can be grouped using parenthesis
|
Supported Operators
=, !=, >, <, >=, <=, &, |
|
Message header supports only JSON object. Multiple header properties can be posted with single JSON object
Message payload can be of any type (string, integer, object, JSON etc)
Index
- Install
- Usage
- Import into Angular 2+ application (typescript)
- API
- createQueue(name: string): boolean
- deleteQueue(name: string): boolean
- getQueueNames(): string[]
- getSubscribers(): string[]
- publish(name: string, headers: any, message: any, lazy = true): boolean
- subscribe(name: string, msgSelector: string, callback: (any, any) => void, lazy = true): string
- unsubscribe(id: string): boolean
- Example
- License
Install
npm install ngx-message-queue
Usage
Import into Angular 2+ application (typescript)
ngx-message-queue
is implemented as Angular 2+ injectable service name NgxMessageQueue.
For apps using angular version 6+
NgxMessageQueue
is Injectable as root so no additional decalaration is required in any module.
For apps using angular version prior to 6
Add
NgxMessageQueue
into module providers.import { NgxMessageQueue } from 'ngx-message-queue';
@NgModule({
providers: [NgxMessageQueue]
})
Each component to use NgxMessageQueue
import { NgxMessageQueue } from 'ngx-message-queue';
export class MyComponent {
constructor(private messageQueue: NgxMessageQueue) { }
}
API
createQueue(name: string): boolean
createQueue
will create queue name
.
Return
false
if queue name
exist.this.messageQueue.createQueue('myQueue');
deleteQueue(name: string): boolean
deleteQueue
will delete queue name
.
Return
false
if queue name
does not exist.this.messageQueue.deleteQueue('myQueue');
getQueueNames(): string[]
getQueueNames
will return all queue name in string array.let qNames: string[] = this.messageQueue.getQueueNames();
getSubscribers(): string[]
getSubscribers
will return all subscribers id in string array.let ids: string[] = this.messageQueue.getSubscribers();
publish(name: string, headers: any, message: any, lazy = true): boolean
publish
will put message
into queue name
. It will also put headers
into queue if any. headers
are optional but it is best way to process/route/filter the messages quickly without parsing the message payload.
If
lazy = true
(default), queue name
will be created automatically if not exist yet.
Return true if successful.
Return false if any of following is true:
lazy = false
, and queuename
does not exist.name
is undefined.message
is undefined.
// lazy mode
message = 'This is a test message';
this.mq.publish('myQueue', {}, message);
subscribe(name: string, msgSelector: string, callback: (any, any) => void, lazy = true): string
subscribe
will subscribe for the message posted on the queue name
. Whenever queue name
receives a new message, callback
will be invoked. The callback will return both headers and message payload.
Subscribers can
subscribe
to only certain messages within the same queue. Let us say you have multiple subscribers listening for log messages with different logging level (debug, info, warn, fatal etc). If you want to configure high priority subscriber who listens for logs with 'fatal' level then use msgSelector as loglevel=fatal
this.mq.subscribe('myQueue', 'loglevel=fatal', (headers, message) => this.handleMessage(headers, message));
If
lazy = true
(default), queue name
will be created automatically if not exist yet.
Return subscription id if successful.
Return empty string if any of following is true:
lazy = false
, and queuename
does not exist.name
is undefined.callback
is undefined.
Either use Lambda(fat arrow) in typescript to pass in callback or bind
this
to another variable in javascript, else this
scope will be lost.
Lambda(fat arrow)
ngOnInit() {
this.mq.subscribe('testqueue', '', (headers, message) => this.handleMessage(headers, message));
}
handleMessage(headers, message) {
console.log(message);
}
unsubscribe(id: string): boolean
unsubscribe
will cancel subscription using id
.unsubscribe
will return false if id
is undefined or id
is not found in subscription list.id: string;
this.messageQueue.unsubscribe(this.id);
Example
Github: ng2-message-queue-example
nice post thanks
ReplyDeleteappvn app
Splitwise app
very nice article, tks u.
ReplyDeleteThis is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to article very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
ReplyDeleteDedicatedHosting4u.com
I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.
ReplyDeleteSoftware testing online training
Software testing certification training
Software testing online course
Software testing training course
Nice Article and Thank you for sharing the informative informations...!
ReplyDeleteOracle DBA Course in Chennai
oracle dba training institutes in chennai
Pega Training in Chennai
Linux Training in Chennai
Unix Training in Chennai
Advanced Excel Training in Chennai
Placement Training in Chennai
Soft Skills Training in Chennai
JMeter Training in Chennai
Job Openings in Chennai
Oracle DBA Training in Anna Nagar
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeletedata science course in mumbai
Impressive! I finally found great post here. Nice article on data science . It's really a nice experience to read your post. Thanks for sharing your innovative ideas to our vision.
ReplyDeleteData Science Course
Data Science Course in Marathahalli
I like your article Your take on this topic is well-written and original. I would never have thought of this.
ReplyDeleteSEO Services in Kolkata
Best SEO Services in Kolkata
SEO Company in Kolkata
Best SEO Company in Kolkata
Top SEO Company in Kolkata
Top SEO Services in Kolkata
SEO Services in India
SEO Company in India
Wow! This article is jam-packed full of useful information. The points made here are clear, concise, readable and poignant. I honestly like your writing style.
ReplyDeleteSAP training in Kolkata
Best SAP training in Kolkata
SAP training institute in Kolkata
In the event that I needed to give an extraordinary case of top quality substance, this article would be it. It's an elegantly composed critique that holds your advantage.
ReplyDeleteOnline Teaching Platforms
Online Live Class Platform
Online Classroom Platforms
Online Training Platforms
Online Class Software
Virtual Classroom Software
Online Classroom Software
Learning Management System
Learning Management System for Schools
Learning Management System for Colleges
Learning Management System for Universities
I am incessantly thought about this, thanks for putting up. website design company nyc
ReplyDeleteFound your weblog and decided to have a study on it, not what I usually do, but this blog is wonderful. Awesome to see a site that’s not spammed, and actually makes some sense. Anyway, great write up. web design manhattan
ReplyDeletevery nice post, i actually love this web site, keep on it branding agencies in san francisco
ReplyDeleteGreat post, you have pointed out some fantastic details , I besides believe this s a very great website. branding firms san francisco
ReplyDelete
ReplyDeleteGood one. Pros and cons are at once place and easy to pick suitable windows automation tool.
Software Testing Training in Chennai | Software Testing Training in Anna Nagar | Software Testing Training in OMR | Software Testing Training in Porur | Software Testing Training in Tambaram | Software Testing Training in Velachery
Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!
ReplyDeletePMP Certification
PMP Course
PMP Course in Malaysia
PMP Training in Malaysia
PMP Training
ReplyDeleteI am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
360DigiTMG PMP Certification
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!data science course
ReplyDeleteThanks for sharing great information. I like your blog and highly recommendData Science Training in Hyderabad
ReplyDeleteReally nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
ReplyDeletevisit for more details
You really make it look so natural with your exhibition however I see this issue as really something which I figure I could never understand. It appears to be excessively entangled and incredibly expansive for me.360DigiTMG data scientist malaysia
ReplyDeleteThanks for sharining...
ReplyDeleteiot training in delhi
Extraordinary post. I simply found your blog and expected to express that I have genuinely refreshing scrutinizing your blog sections.Huge thankful for the significant data.
ReplyDeleteHRDF training
Super article
ReplyDeleteartificial neural network
what is artificial neural network
what is an artificial neural network
application of artificial neural network
artificial neural network application
artificial neural network pdf
artificial neural network ppt
artificial neural network tutorial
artificial neural network definition
artificial neural network types
I found Hubwit as a transparent s ite, a social hub which is a conglomerate of Buyers and Sellers who are ready to offer online digital consultancy at decent cost.
ReplyDeleteBest Institute for Data Science in Hyderabad
I will really appreciate the writer's choice for choosing this excellent article appropriate to my matter.Here is deep description about the article matter which helped me more.
ReplyDeletedata scientist courses
Thanks for sharing amazing blog. I am really happy to read your blog. Thanks for sharing your blog.
ReplyDeleteAndroid Training in Tambaram
Android Training in Anna Nagar
Android Training in Velachery
Android Training in T Nagar
Android Training in Porur
Android Training in OMR
This is my first time visit here. From the tremendous measures of comments on your articles.I deduce I am not only one having all the fulfillment legitimately here!
ReplyDeleteinternet of things malaysia
Thanks for sharing great information. I highly recommend you.data science courses
ReplyDelete
ReplyDeleteThankful to you a particularly lot for ding the stunning situation here, everyone will surely like your post.
iot certification courses
Thanks for sharing a wonderful article, it is helpful for everyone, excellent post.
ReplyDeletedigital marketing trends
big data vs data science
latest technology trends
types of graphic design
rpa interview questions
angularjs interview questions
NTC National Telecommunication Corporation Jobs
ReplyDeletePlumbing & HVAC Services San Diego
ReplyDeleteAir Star Heating guarantees reliability and quality for all equipment and services.
Air Star Heating is specializing in providing top-quality heating, ventilating, air conditioning, and plumbing services to our customers and clients.
Our company is leading the market right now. By using our seamless and huge array of services. Our customers can now have the privilege of taking benefit from our services very easily and swiftly. To cope up with the desires and needs of our clients we have built an excellent reputation. We are already having a huge list of satisfied customers that seem to be very pleased with our services.
Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
Visit:- https://airstarheating.com
Thanks for sharing such a useful content. I really liked it. Keep sharing more!
ReplyDeleteData Science Course in Hyderabad
Mua vé máy bay tại Aivivu, tham khảo
ReplyDeletegiá vé máy bay đi Mỹ khứ hồi
chuyến bay mỹ về việt nam
chuyến bay từ canada về việt nam
taxi sân bay
This is a fabulous post I seen because of offer it. It is really what I expected to see trust in future you will continue in sharing such a mind boggling post
ReplyDeletedata scientist training and placement
I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. baixar whatsapp gb versão mais recente
ReplyDeleteI just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You.
ReplyDeletedata science training in pune
You’re so interesting! I don’t believe I’ve truly read something like this before. So great to find someone with genuine thoughts on this issue. Really.. many thanks for starting this up. This website is something that’s needed on the internet, someone with some originality!
ReplyDeleteCBSE Schools In Attapur
CBSE Schools In Bachupally
CBSE Schools In Banjara Hills
CBSE Schools In Begumpet
CBSE Schools In Bowenpally
CBSE Schools In Budgam
CBSE Schools In Hyderabad
CBSE Schools In Chintal
CBSE Schools In ECIL
CBSE Schools In Gachibowli
Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. how to start a payment processing company
ReplyDeleteI really enjoy reading and also appreciate your work.
ReplyDeletedata science course in pune
youtube abone satın al
ReplyDeletecami avizesi
cami avizeleri
avize cami
no deposit bonus forex 2021
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
instagram beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
no deposit bonus forex 2021
tiktok jeton hilesi
tiktok beğeni satın al
binance
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
Fantastic!! you are doing good job! I impressed. Many bodies are follow to you and try to some new.. After read your comments I feel; Its very interesting and every guys sahre with you own works. Great!!
ReplyDeletechuyến bay từ Sydney đến thành phố hồ chí minh
Máy bay từ Hàn Quốc về Việt Nam
Vé máy bay giá rẻ tu Nhat Ban ve Viet Nam
Ve may bay Bamboo tu Dai Loan ve Viet Nam
mua vé máy bay từ canada về việt nam
ve may bay từ mỹ về việt nam hãng eva
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeletecác chuyến bay từ nga về việt nam
chuyến bay từ frankfurt đến hà nội
mua vé máy bay từ anh về việt nam
combo cách ly trọn gói 14 ngày HCM
giá taxi đi sân bay nội bài
xin visa kết hôn Hàn Quốc
poker onlineพร้อมวิธีเล่นโป๊กเกอร์ออนไลน์ และเทคนิค เล่นไพ่
ReplyDeleteWow its a very good post. The information provided by you is really very good and helpful for me. Keep sharing good information. SEO Gloucester
ReplyDeleteGreat survey, I'm sure you're getting a great response. hatena
ReplyDeletegoodreads
scoop
buzzfeed
4shared
Informative blog, big thumbs up for sharing this blog with us.
ReplyDeleteData Science Course in Hyderabad with Placements
There is no one-size-fits-all answer to this question, as the role of a payment processor can vary depending on the size and scope of the business. However, some tips on How to be a Payment Processor include understanding the payment processing industry, being able to identify potential risks associated with payments.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteExpress VPN Activation Code for PC gives you you with biggest IP Hiding service that nobody can conduct. The software’s popularity and need to get is soaring day by day. It is usually VPN tool which conceal your all duties from hackers
ReplyDeleteslot pay4D terpercaya bonus 100% didepan ANZSLOT deposit pulsa 24 jam tanpa potongan paling gacor se Indonesia.
ReplyDeleteAny creature can look at the WiFi Password Hacker Online section in the diagram and would like to use it for free. Online Wifi Hacker
ReplyDeleteGet intelligent suggestions in the Editor Overview pane in Word and let Editor assist you across documents, email, and on the web Download MS Office 2016 With Crack
ReplyDeleteDeep Dark Love Quotes quotations area unit simply phrases or quotes concerning deep love with such a splash of romance, tranquilly, and joy thrown certain smart live. True Love Dark Love Quotes
ReplyDeleteGreat Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.
ReplyDeletecyber security course
รูปแบบเกมเล่นง่าย ไม่จำเจ เปลี่ยนการเล่นรูปแบบเดิมๆ ให้สนุกมากขึ้น ที่สุดแห่งแจ็กพ็อตแตกง่าย แตกบ่อย ไม่ต้องฝาก ไม่ต้องแชร์ เล่นได้เลยตอนนี้ผ่านเว็บไซต์ PGSLOTGAMES ทำกำไรได้อย่างรวดเร็ว รวยไปกับการเล่นจากทาง พีจี ไปเลยทันที PGทางเข้า
ReplyDeleteพร้อมรับความรวยได้เลย PG ทางเข้า เล่นเกมได้ง่ายผ่านทางเข้า PG ลุ้นรับโบนัสก้อนโต เล่นได้ก่อนใคร ทำกำไรได้ดั่งใจ พร้อมรับโบนัสใหม่ๆได้ทันที สมัครสมาชิกง่าย โดยไม่ต้องเสียค่าใช้จ่าย มีโปรโมชั่นให้เลือกมากมาย เริ่มตั้งแต่สมัครสมาชิก รับ 100 บาททันที
ReplyDeleteIt’s awesome to pay a visit to this web page and reading the views of all friends regarding this paragraph, while I am also eager of getting experience
ReplyDeleteAzure Data Factory course in hyderabad
Azure Data Engineer Training Online Hyderabad
azure training in hyderabad ameerpet
Azure Data Factory online Training in Hyderabad
Microsoft Azure Data Factory in hyderabad
beykoz alarko carrier klima servisi
ReplyDeletemaltepe lg klima servisi
kadıköy lg klima servisi
kadıköy alarko carrier klima servisi
maltepe daikin klima servisi
kadıköy daikin klima servisi
kartal toshiba klima servisi
ümraniye toshiba klima servisi
kartal beko klima servisi
This comment has been removed by the author.
ReplyDeleteSo, admirable blog content its too good.
ReplyDeleteTenorshare Icarefone Crack
Advanced Systemcare Crack
Avocode Crack
เปิดกระเป๋าสตางค์ของคุณและดูเงิน คุณไม่มีเงินใช้สักบาทใช่ไหม ลองมาเล่นเกมกับเราและดูแล้วคุณจะมีเงินใช้ แวะเข้าไปเล่น ทางเข้าเล่นpg https://www.pgslot168game.com/login-pgslot/ เพื่อเล่นเกมสล็อตออนไลน์ง่ายๆ เล่นไม่ยาก ไม่ซับซ้อน แค่หมุนก็มีสิทธิ์ลุ้นรางวัลใหญ่และรางวัลใหญ่อีกมากมายจากางค่าย PG ที่ได้รวบรวมเกมดีมาให้เล่นได้อย่างไม่มีเบื่อ
ReplyDeleteThank you for sharing your thoughts.
ReplyDeleteWise Care 365 Pro Crack Key
https://freeproversion.com/wise-care-365-pro-crack-key-latest/
I think I have never seen such blogs ever before that has complete things with all details which I want. So kindly update this ever for us.
ReplyDeletefull stack developer course with placement
Wow, this is a fantastic post. Your information is pretty excellent and beneficial to me. Share more accurate information. If anyone wants to learn data science visit at data science course in bhopal
ReplyDeleteWow such an amazing post .
ReplyDeleteDigitizeDigitally
We are also provide crack software. It has a wonderful feature. This is a good job. It is easy to use.
ReplyDeletehttps://azanpc.com/wondershare-filmora-11-crack-download-latest-version/
Historically, many casinos, each online and offline, have been unwilling to publish particular person sport RTP figures, making it inconceivable for the player to know whether or not they are enjoying in} a "free" or a "tight" sport. It is important that the machine accommodates a high-quality RNG implementation. Because all PRNGs must eventually repeat their casino.edu.kg quantity sequence and, if the period is brief or the PRNG is otherwise flawed, an advanced player may be able to|could possibly|might be able to} "predict" the following outcome.
ReplyDeleteMicrosoft Office 2010
ReplyDeleteMicrosoft Office 2010 is great software which is use to enhance the working in system.
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteTop 3 psychiatrist in Lucknow
ReplyDeleteTop 3 psychiatrist in Lucknow
Managing and enhancing mental health depend on getting professional help from a psychiatrist. In this article, we will examine how to locate the Top 3 psychiatrist in Lucknow near you. We will also review a psychiatrist's training, job duties, appropriate times to see one, and what to expect at your first appointment. We'll also talk about the queries and exams a psychiatrist in Lucknow
might use.
This is nice Artical and informative for me,.. imranpc.com
ReplyDelete