Tuesday, November 20, 2007

setting Hermes v1.12 config for monitor ActiveMQ 4.1.1 on WindowsXP

1. ทำการ set config classpath โดยไปที่ Option->Configuration->Provider โดยคลิกขวาแล้ว Add library ดังนี้
- apache-activemq-4.1.1.jar
- backport-util-concurrent-2.1.jar
- geronimo-j2ee-management_1.0_spec-1.0.jar

กด OK เพื่อยืนยัน


2. new session เพื่อกำหนดการเฝ้ามองที่ Queue ของ ActiveMQ

จะได้หน้าจอในการ กำหนดค่าโดยกำหนดค่าได้ดังภาพ

- ส่วนของ Plug-In คลิกขวาแล้ว Add เพื่อเพิ่ม config การจะควบคุมActiveMQ ให้เต็มที่ต้องเปิด Service:jmx และกำหนดการติดต่อโดยการเปิด Service:jmx ที่ ActiveMQ ในส่วนนี้โดย จะแสดงรายละเอียดในหัวข้อถัดไป โดยกำหนดค่าดังนี้
eg. service:jmx:rmi:///jndi/rmi://localhost:1616/jmxrmi

- ส่วนของ Connection Factory ต้องกำหนด brokerUrl ไปยังเครื่องที่ต้องการ remote ไปดูได้
eg. tcp://127.0.0.1:61616

- ส่วน Destination คลิกขวาเพื่อ Add queue หรือ topic ที่ต้องการ monitoring
3. การเปิดในส่วนของ Service:jmx โดยเปิดไฟล์ [activemqpath]/bin/activemq.bat แก้ไขบรรทัดที่ประมาณ 92 ลบ rem หน้าข้อความ
set SUNJMX=-Dcom.sun.management.jmxremote.port=1616..........

Wednesday, November 14, 2007

การทำ global var บน webservice

การสร้าง global variable บน webservice
- เป็น global variable
- เป็น multiuser ซึ่ง ทุก user จะมองเห็น variable ตัวเดียวกัน
eg. Object obj = new Object();
การเซตค่า
Application.set("myvar",obj);
การget ค่า
Object a = (Object)Application.get("myvar");

Monday, October 22, 2007

Tip Dialog Box in ASP.NET

easy Dailog box in ASP.NET i'm use to show Error use "JavaScript"

Response.Write("<script>");


Response.Write("alert('Hello World');");


Response.Write("</script>");

it will show message Dialog when it work.

Saturday, October 6, 2007

ส่งค่าข้าม Page กับ ASP.NET

หน้าแรก

public partial class SendFile : System.Web.UI.Page
{
public string getFilePath
{
get {
HttpPostedFile pf = fileupload.PostedFile;
return pf.FileName;
}
}
// เมื่อคลิกส่ง

protected void cmdXMLInfo_Click(object sender, EventArgs e)
{
Server.Transfer("~/XmlDescription.aspx", true);
}
}

หน้าสองรับข้อมูลจากหน้าแรก



<%@ PreviousPageType VirtualPath="JobCreator2.aspx" %>
public partial class XmlDescription : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string filePath = "";
if (PreviousPage != null)
{
SendFile sf = PreviousPage as SendFile;
if (sf != null)
{
try
{
filePath = sf.getFilePath;
XmlManage xm = new XmlManage();
MyProcess[] mypro = xm.ReadXmlFrom(filePath);
gridviewXML.DataSource = mypro;
gridviewXML.DataBind();
}
catch(Exception err)
{
result.Text = err.Message;
}
}
}
}

}

Sunday, June 17, 2007

คียร์ลัด

windows + E = Windows Explorer
windows + R = Run
Windows Key + Pause/Break = Displays the Systems Properties dialog box.

Sunday, May 20, 2007

วิธี เช็คเมสเสจของ ActiveMQ with C#

ตรวจว่า message ที่รับเข้ามาเป็นแบบใด โดยใช้การ GetType() ของ object

IMessage message = consumer.Receive("TEST.FOO");

Type
amqTypeText = typeof(ActiveMQTextMessage);
Type amqTypeBinary = typeof(ActiveMQBytesMessage);
Type amqStream = typeof(ActiveMQStreamMessage);

Console.WriteLine("message type is:" + message.GetType());

if (amqTypeText.IsInstanceOfType(message))
{
Console.WriteLine("receive TEXT message");
ActiveMQTextMessage _textMessage = (ActiveMQTextMessage)message;
messageType = _textMessage.NMSType;
data = Encoding.ASCII.GetBytes(_textMessage.Text);
}
if (amqTypeBinary.IsInstanceOfType(message))
{
Console.WriteLine("receive BYTE message");
ActiveMQBytesMessage _bytesMessage = (ActiveMQBytesMessage)message;
messageType = _bytesMessage.NMSType;
data = _bytesMessage.Content;
}
if (amqStream.IsInstanceOfType(message))
{
Console.WriteLine("receive Stream messge");
ActiveMQStreamMessage _streamMessage = (ActiveMQStreamMessage)message;
messageType = _streamMessage.NMSType;
data = _streamMessage.Content;
}

Wednesday, May 16, 2007

ปัญหาสาวกFirefox เล่นไฟล์ของ WindowsMedia ไม่ได้

Firefox รุ่นหลังๆ จะมีปัญหากับ ActiveX ทำให้ฟังเพลงหรือเล่นไฟล์ของ WindowsMedia จากเวปไม่ได้ จิงสมควรดาวโหลดสิ่งนี้ไปใชักันนะคร๊าบผม

Firefox 1.5 or 1.5.0.1

http://www.iol.ie/~locka/mozilla/mozactivex-ff-15.xpi

memory สมองมันเต็ม

เนื่องจากนับวันหน่วยความจำในสมองของผมมันชักจะเต็ม ก็เลยหาที่ช่วยจัดเก็บ
ครั้งแรกก็บรรจุลง Word Document แต่ชักแย่ด้านการจัดการ ค้นหา และมันรุงรังกับเครื่องคอม
สรุปผลก็เลยมาลงที่ Blogger เนื่องจากเป็นสมาชิกของ Gmail อยู่แล้วด้วย
ก็เลยมาทดลองนำความรู้ที่มันจำไม่ได้หรือบังเอิญไปเจอ ว่าจะมาลงที่ blog นี้เอาไว้เตือนความจำตัวเอง
หรือทำให้มันหาได้ง่ายขึ้นเวลาต้องการใช้นั่นเอง หุหุหุหุ